FFI: Correctly propagate alignment when interning nested types.

master
Mike Pall 2012-09-10 18:05:54 +02:00
parent 21cea85d92
commit 76ab3709da
1 changed files with 3 additions and 1 deletions

View 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));
}