We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b729f4c + 1f3ff2c commit ba92028Copy full SHA for ba92028
lib/IRGen/IRGen.cpp
@@ -499,7 +499,11 @@ swift::createTargetMachine(IRGenOptions &Opts, ASTContext &Ctx) {
499
500
// Create a target machine.
501
auto cmodel = CodeModel::Default;
502
- if (Triple.isWindowsCygwinEnvironment())
+
503
+ // On Windows 64 bit, dlls are loaded above the max address for 32 bits.
504
+ // This means that a default CodeModel causes generated code to segfault
505
+ // when run.
506
+ if (Triple.isArch64Bit() && Triple.isOSWindows())
507
cmodel = CodeModel::Large;
508
509
llvm::TargetMachine *TargetMachine =
0 commit comments