Explorar o código

FFI: Correctly propagate alignment when interning nested types.

Mike Pall %!s(int64=13) %!d(string=hai) anos
pai
achega
76ab3709da
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/lj_cparse.c

+ 3 - 1
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));
       }