Commit 6db589fff5

Andrew Kelley <superjoe30@gmail.com>
2017-10-01 02:20:51
don't try to use cold calling convention on windows
it just causes a segfault
1 parent 08708ea
Changed files (1)
src/codegen.cpp
@@ -337,7 +337,12 @@ static LLVMCallConv get_llvm_cc(CodeGen *g, CallingConvention cc) {
             if (g->zig_target.arch.arch == ZigLLVM_x86 ||
                 g->zig_target.arch.arch == ZigLLVM_x86_64)
             {
-                return LLVMColdCallConv;
+                // cold calling convention is not supported on windows
+                if (g->zig_target.os == ZigLLVM_Win32) {
+                    return LLVMCCallConv;
+                } else {
+                    return LLVMColdCallConv;
+                }
             } else {
                 return LLVMCCallConv;
             }