mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Only remark if the last digit mismatches in precise tag check
Weaken the precise tag check at loading swiftmodule to accept binary modules build by a compiler with a tag where only the last digit is different. We assume that the other digit in the version should ensure compiler and stdlib compatibility. If the last digit doesn't match, still raise a remark. rdar://105158258
This commit is contained in:
@@ -836,6 +836,13 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
if (loadedModuleFile &&
|
||||
loadedModuleFile->mayHaveDiagnosticsPointingAtBuffer())
|
||||
OrphanedModuleFiles.push_back(std::move(loadedModuleFile));
|
||||
} else {
|
||||
// Report non-fatal compiler tag mismatch.
|
||||
if (!loadInfo.problematicRevision.empty()) {
|
||||
Ctx.Diags.diagnose(*diagLoc,
|
||||
diag::serialization_module_problematic_revision,
|
||||
loadInfo.problematicRevision, moduleBufferID);
|
||||
}
|
||||
}
|
||||
|
||||
// The -experimental-hermetic-seal-at-link flag turns on dead-stripping
|
||||
@@ -896,7 +903,7 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
|
||||
break;
|
||||
case serialization::Status::RevisionIncompatible:
|
||||
Ctx.Diags.diagnose(diagLoc, diag::serialization_module_incompatible_revision,
|
||||
ModuleName, moduleBufferID);
|
||||
loadInfo.problematicRevision, ModuleName, moduleBufferID);
|
||||
break;
|
||||
case serialization::Status::Malformed:
|
||||
Ctx.Diags.diagnose(diagLoc, diag::serialization_malformed_module,
|
||||
|
||||
Reference in New Issue
Block a user