From: sergos@tarantool.org To: tarantool-patches@freelists.org Subject: [tarantool-patches] [PATCH] Test for LuaJIT fold machinery incorrect behavior Date: Thu, 25 Jul 2019 12:05:14 +0000 [thread overview] Message-ID: <20190725120514.849-1-sergos@tarantool.org> (raw) There's a problem in LuaJIT fold transformations machinery. The test exposes the wrong behavior and will be used for local temporary fix in Tarantool repo. Follow up for the problem resolution is planned. https://github.com/LuaJIT/LuaJIT/issues/505 Follow-up #4376 --- test/luajit-tap/fold_bug_LuaJIT_505.test.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 test/luajit-tap/fold_bug_LuaJIT_505.test.lua diff --git a/test/luajit-tap/fold_bug_LuaJIT_505.test.lua b/test/luajit-tap/fold_bug_LuaJIT_505.test.lua new file mode 100755 index 000000000..666a08eaf --- /dev/null +++ b/test/luajit-tap/fold_bug_LuaJIT_505.test.lua @@ -0,0 +1,20 @@ +#!/usr/bin/env tarantool + +tap = require('tap') + +test = tap.test("505") +test:plan(1) + +-- Test file to demonstrate Lua table hash chain bugs discussed in +-- https://github.com/LuaJIT/LuaJIT/issues/505 + +jit.opt.start("hotloop=1") +for _ = 1, 20 do + local value = "abc" + local pos_c = string.find(value, "c", 1, true) + local value2 = string.sub(value, 1, pos_c - 1) + local pos_b = string.find(value2, "b", 2, true) + assert(pos_b == 2, "FAIL: position of 'b' is " .. pos_b) +end + +test:ok("PASS") -- 2.17.1
reply other threads:[~2019-07-25 12:05 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190725120514.849-1-sergos@tarantool.org \ --to=sergos@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH] Test for LuaJIT fold machinery incorrect behavior' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox