]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Correctly propagate alignment when interning nested types.
authorMike Pall <mike>
Mon, 10 Sep 2012 16:05:54 +0000 (18:05 +0200)
committerMike Pall <mike>
Mon, 10 Sep 2012 16:05:54 +0000 (18:05 +0200)
src/lj_cparse.c

index ab5903fa210dce77e5878726d3b2643a4fd6878f..6642e8d8149288417d3ad63d98d0c8aeeef76303 100644 (file)
@@ -918,7 +918,9 @@ static CTypeID cp_decl_intern(CPState *cp, CPDecl *decl)
            size = (CTSize)xsz;
          }
        }
-       info |= (cinfo & (CTF_QUAL|CTF_ALIGN));  /* Inherit qual and align. */
+       if ((cinfo & CTF_ALIGN) > (info & CTF_ALIGN))  /* Find max. align. */
+         info = (info & ~CTF_ALIGN) | (cinfo & CTF_ALIGN);
+       info |= (cinfo & CTF_QUAL);  /* Inherit qual. */
       } else {
        lua_assert(ctype_isvoid(info));
       }