Skip to content

Commit cf3317e

Browse files
committed
Code review feedback from @jrose-apple for "95e9a0 The frontend should stop if the stdlib failed to load"
1 parent 01c4c6a commit cf3317e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Frontend/Frontend.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ void CompilerInstance::performSema() {
256256
}
257257

258258
// If we failed to load, we should have already diagnosed
259-
if (M->failedToLoad())
259+
if (M->failedToLoad()) {
260+
assert(Diagnostics.hadAnyError() &&
261+
"Module failed to load but nothing was diagnosed?");
260262
return;
263+
}
261264

262265
break;
263266
}

test/ClangModules/bad-deployment-target.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %swift -parse -target x86_64-apple-macosx10.8 %clang-importer-sdk -I %S/Inputs/custom-modules %s
1+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -target x86_64-apple-macosx10.8 %s
22
//
33
// This test ensures that a -target that is too old for the standard library
44
// will not crash in the ClangImporter.

0 commit comments

Comments
 (0)