FFI: Fix recording of union initialization.

Thanks to Alex Shpilkin.
This commit is contained in:
Mike Pall 2020-12-28 12:37:36 +01:00
parent d67ff15a5c
commit 56c04accf9

View File

@ -959,6 +959,11 @@ static void crec_alloc(jit_State *J, RecordFFData *rd, CTypeID id)
dp = emitir(IRT(IR_ADD, IRT_PTR), trcd,
lj_ir_kintp(J, df->size + sizeof(GCcdata)));
crec_ct_tv(J, dc, dp, sp, sval);
if ((d->info & CTF_UNION)) {
if (d->size != dc->size) /* NYI: partial init of union. */
lj_trace_err(J, LJ_TRERR_NYICONV);
break;
}
} else if (!ctype_isconstval(df->info)) {
/* NYI: init bitfields and sub-structures. */
lj_trace_err(J, LJ_TRERR_NYICONV);