Skip to content

Commit

Permalink
FFI: Fix recording of union initialization.
Browse files Browse the repository at this point in the history
Thanks to Alex Shpilkin.
  • Loading branch information
Mike Pall committed Dec 28, 2020
1 parent d67ff15 commit 56c04ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lj_crecord.c
Expand Up @@ -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);
Expand Down

0 comments on commit 56c04ac

Please sign in to comment.