Skip to content

Commit 718579c

Browse files
committed
[Serialization] Don't allow simulator and non-simulator modules to mix.
1 parent 90336cf commit 718579c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,10 @@ static bool areCompatibleArchitectures(const llvm::Triple &moduleTarget,
13411341

13421342
static bool areCompatibleOSs(const llvm::Triple &moduleTarget,
13431343
const llvm::Triple &ctxTarget) {
1344+
if ((!moduleTarget.hasEnvironment() && ctxTarget.isSimulatorEnvironment()) ||
1345+
(!ctxTarget.hasEnvironment() && moduleTarget.isSimulatorEnvironment()))
1346+
return false;
1347+
13441348
if (moduleTarget.getOS() == ctxTarget.getOS())
13451349
return true;
13461350

0 commit comments

Comments
 (0)