forked from LuaJIT/LuaJIT
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix frame for more types of on-trace error messages.
Thanks to Maxim Kokryashkin. (cherry-picked from commit d5bbf9c) This patch fixes the same issue with frame, as the previous one, but now for the table overflow error in the `err_msgv` function. The test for the problem uses the table of GC finalizers, although they are not required to reproduce the issue. They only used to make the test as simple as possible. Resolves tarantool/tarantool#562 Part of tarantool/tarantool#8825
- Loading branch information
1 parent
a2c938c
commit 20a9d97
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local tap = require('tap') | ||
local ffi = require('ffi') | ||
local test = tap.test('lj-1034-tabov-error-frame'):skipcond({ | ||
['Test requires JIT enabled'] = not jit.status(), | ||
['Test requires GC64 mode enabled'] = not ffi.abi('gc64'), | ||
['Disabled on MacOS due to #8652'] = jit.os == 'OSX', | ||
}) | ||
|
||
test:plan(2) | ||
|
||
-- luacheck: no unused | ||
local anchor = {} | ||
local function on_gc(t) end | ||
|
||
local function test_finalizers() | ||
local i = 1 | ||
while true do | ||
anchor[i] = ffi.gc(ffi.cast('void *', 0), on_gc) | ||
i = i + 1 | ||
end | ||
end | ||
|
||
local st, err = pcall(test_finalizers) | ||
st, err = pcall(test_finalizers) | ||
test:ok(st == false, 'error handled successfully') | ||
test:like(err, '^.+table overflow', 'error is table overflow') | ||
test:done(true) |