From: Mike Pall Date: Mon, 8 Sep 2014 21:37:22 +0000 (+0200) Subject: FFI: Fix initialization of unions of subtypes. X-Git-Tag: v2.0.4~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41156fe1cdd6b60a5e8d9855c57699e89ccfbf97;p=thirdparty%2FLuaJIT.git FFI: Fix initialization of unions of subtypes. Thanks to Peter Colberg. --- diff --git a/src/lj_cconv.c b/src/lj_cconv.c index de4938e4..90cd36e3 100644 --- a/src/lj_cconv.c +++ b/src/lj_cconv.c @@ -702,6 +702,7 @@ static void cconv_substruct_init(CTState *cts, CType *d, uint8_t *dp, } else if (ctype_isxattrib(df->info, CTA_SUBTYPE)) { cconv_substruct_init(cts, ctype_rawchild(cts, df), dp+df->size, o, len, ip); + if ((d->info & CTF_UNION)) break; } /* Ignore all other entries in the chain. */ } }