Skip to content
Snippets Groups Projects
Commit 022a3c50 authored by Georgy Kirichenko's avatar Georgy Kirichenko Committed by Vladimir Davydov
Browse files

lua: fix tuple cdata collecting

In some cases luajit does not collect cdata objects which were
transformed with ffi.cast as tuple_bless does. In consequence, internal
table with gc callback overflows and then lua crashes. There might be an
internal luajit issue because it fires only for jitted code. But assigning
a gc callback before transformation fixes the problem.

Closes #3751
parent e4338cc5
No related branches found
No related tags found
No related merge requests found
...@@ -100,7 +100,7 @@ local tuple_bless = function(tuple) ...@@ -100,7 +100,7 @@ local tuple_bless = function(tuple)
-- overflow checked by tuple_bless() in C -- overflow checked by tuple_bless() in C
builtin.box_tuple_ref(tuple) builtin.box_tuple_ref(tuple)
-- must never fail: -- must never fail:
return ffi.gc(ffi.cast(const_tuple_ref_t, tuple), tuple_gc) return ffi.cast(const_tuple_ref_t, ffi.gc(tuple, tuple_gc))
end end
local tuple_check = function(tuple, usage) local tuple_check = function(tuple, usage)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment