mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Fix dangling reference to CType.
This commit is contained in:
parent
c2cfa04231
commit
ae533e3a6c
@ -557,7 +557,9 @@ void lj_cconv_ct_tv(CTState *cts, CType *d,
|
|||||||
}
|
}
|
||||||
s = ctype_raw(cts, sid);
|
s = ctype_raw(cts, sid);
|
||||||
if (ctype_isfunc(s->info)) {
|
if (ctype_isfunc(s->info)) {
|
||||||
|
CTypeID did = ctype_typeid(cts, d);
|
||||||
sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR);
|
sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR);
|
||||||
|
d = ctype_get(cts, did); /* cts->tab may have been reallocated. */
|
||||||
} else {
|
} else {
|
||||||
if (ctype_isenum(s->info)) s = ctype_child(cts, s);
|
if (ctype_isenum(s->info)) s = ctype_child(cts, s);
|
||||||
goto doconv;
|
goto doconv;
|
||||||
|
Loading…
Reference in New Issue
Block a user