FFI: Fix ffi.alignof() for reference types.

Reported by Eric Gouyer.
This commit is contained in:
Mike Pall
2022-07-13 00:32:04 +02:00
parent 27a6fee82e
commit 36b2962d40
3 changed files with 10 additions and 1 deletions

View File

@@ -328,6 +328,14 @@ CTInfo lj_ctype_info(CTState *cts, CTypeID id, CTSize *szp)
return qual;
}
/* Ditto, but follow a reference. */
CTInfo lj_ctype_info_raw(CTState *cts, CTypeID id, CTSize *szp)
{
CType *ct = ctype_get(cts, id);
if (ctype_isref(ct->info)) id = ctype_cid(ct->info);
return lj_ctype_info(cts, id, szp);
}
/* Get ctype metamethod. */
cTValue *lj_ctype_meta(CTState *cts, CTypeID id, MMS mm)
{