mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Ensure returned string is alive in ffi.typeinfo().
Reported by zhuizhuhaomeng.
This commit is contained in:
parent
78350a2565
commit
94a40bb238
@ -573,6 +573,7 @@ LJLIB_CF(ffi_typeinfo)
|
|||||||
setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "sib")), (int32_t)ct->sib);
|
setintV(lj_tab_setstr(L, t, lj_str_newlit(L, "sib")), (int32_t)ct->sib);
|
||||||
if (gcref(ct->name)) {
|
if (gcref(ct->name)) {
|
||||||
GCstr *s = gco2str(gcref(ct->name));
|
GCstr *s = gco2str(gcref(ct->name));
|
||||||
|
if (isdead(G(L), obj2gco(s))) flipwhite(obj2gco(s));
|
||||||
setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "name")), s);
|
setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "name")), s);
|
||||||
}
|
}
|
||||||
lj_gc_check(L);
|
lj_gc_check(L);
|
||||||
|
Loading…
Reference in New Issue
Block a user