mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the same alignment for writing and readin .swift_ast section contents.
This fixes a bug that made it impossible to read any subsequent Swift modules out of a .swift_ast section a previous section had a size divisible by 4. rdar://problem/57110020
This commit is contained in:
@@ -375,8 +375,8 @@ ValidationInfo serialization::validateSerializedAST(
|
||||
ValidationInfo result;
|
||||
|
||||
// Check 32-bit alignment.
|
||||
if (data.size() % 4 != 0 ||
|
||||
reinterpret_cast<uintptr_t>(data.data()) % 4 != 0)
|
||||
if (data.size() % SWIFTMODULE_ALIGNMENT != 0 ||
|
||||
reinterpret_cast<uintptr_t>(data.data()) % SWIFTMODULE_ALIGNMENT != 0)
|
||||
return result;
|
||||
|
||||
llvm::BitstreamCursor cursor(data);
|
||||
|
||||
Reference in New Issue
Block a user