From 76ab3709da40dd3cc3ab9223dde33050430cd789 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 10 Sep 2012 18:05:54 +0200 Subject: [PATCH] FFI: Correctly propagate alignment when interning nested types. --- src/lj_cparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); }