mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Stop reading the control block if the format version doesn't match
rdar://128551774
This commit is contained in:
@@ -334,6 +334,12 @@ static ValidationInfo validateControlBlock(
|
||||
LLVM_FALLTHROUGH;
|
||||
case 3:
|
||||
result.shortVersion = blobData.slice(0, scratch[2]);
|
||||
|
||||
// If the format version doesn't match, give up after also getting the
|
||||
// compiler version. This provides better diagnostics.
|
||||
if (result.status != Status::Valid)
|
||||
return result;
|
||||
|
||||
LLVM_FALLTHROUGH;
|
||||
case 2:
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user