From ae533e3a6c009b5df79b11cd5787d249202fa69c Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 1 Jun 2021 00:26:45 +0200 Subject: FFI: Fix dangling reference to CType. --- src/lj_cconv.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lj_cconv.c b/src/lj_cconv.c index 9c1ecdf5..55a72657 100644 --- a/src/lj_cconv.c +++ b/src/lj_cconv.c @@ -557,7 +557,9 @@ void lj_cconv_ct_tv(CTState *cts, CType *d, } s = ctype_raw(cts, sid); if (ctype_isfunc(s->info)) { + CTypeID did = ctype_typeid(cts, d); 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 { if (ctype_isenum(s->info)) s = ctype_child(cts, s); goto doconv; -- cgit v1.2.1