From: Mike Pall Date: Mon, 10 Sep 2012 16:05:54 +0000 (+0200) Subject: FFI: Correctly propagate alignment when interning nested types. X-Git-Tag: v2.0.0-beta11~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76ab3709da40dd3cc3ab9223dde33050430cd789;p=thirdparty%2FLuaJIT.git FFI: Correctly propagate alignment when interning nested types. --- diff --git a/src/lj_cparse.c b/src/lj_cparse.c index ab5903fa..6642e8d8 100644 --- a/src/lj_cparse.c +++ b/src/lj_cparse.c @@ -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)); }