소스 검색

FFI: Correctly propagate alignment when interning nested types.

Mike Pall 13 년 전
부모
커밋
76ab3709da
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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));
       }