]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Fix initialization of unions of subtypes.
authorMike Pall <mike>
Mon, 8 Sep 2014 21:37:22 +0000 (23:37 +0200)
committerMike Pall <mike>
Mon, 8 Sep 2014 21:37:22 +0000 (23:37 +0200)
Thanks to Peter Colberg.

src/lj_cconv.c

index de4938e4fc6b5c7c7a6180279b5ea0a4b0f0d487..90cd36e34cebf4295fcb23f0724ebb3fcd055a5f 100644 (file)
@@ -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. */
   }
 }