Skip to content

Commit 6f46830

Browse files
committed
[Serialization] Require module files to match on environment, too.
This prevents mixing simulator and non-simulator modules.
1 parent 43bb415 commit 6f46830

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,9 @@ static bool areCompatibleArchitectures(const llvm::Triple &moduleTarget,
13401340

13411341
static bool areCompatibleOSs(const llvm::Triple &moduleTarget,
13421342
const llvm::Triple &ctxTarget) {
1343+
if (moduleTarget.getEnvironment() != ctxTarget.getEnvironment())
1344+
return false;
1345+
13431346
if (moduleTarget.getOS() == ctxTarget.getOS())
13441347
return true;
13451348

0 commit comments

Comments
 (0)