diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-26 02:36:18 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-26 02:36:18 -0400 |
| commit | 8047f0eae2da64a88474dbe9106c61b3e26e6871 (patch) | |
| tree | 6e67a5ac7d615580ac2c5114c2326cc23336574f /src/codegen.cpp | |
| parent | 526338b00fbe1cac19f64832176af3bdf2108a56 (diff) | |
| download | zig-8047f0eae2da64a88474dbe9106c61b3e26e6871.tar.gz zig-8047f0eae2da64a88474dbe9106c61b3e26e6871.zip | |
fix llvm assertion failure when building std lib tests for macos
closes #1417
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 7ea322c1c3..f25ecd8e08 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -5821,6 +5821,7 @@ static void do_code_gen(CodeGen *g) { LLVMSetLinkage(global_value, LLVMExternalLinkage); LLVMSetAlignment(global_value, var->align_bytes); + LLVMSetGlobalConstant(global_value, var->gen_is_const); } } else { bool exported = (var->linkage == VarLinkageExport); @@ -5841,9 +5842,9 @@ static void do_code_gen(CodeGen *g) { if (var->gen_is_const && var->value->type->id != TypeTableEntryIdFn) { gen_global_var(g, var, var->value->global_refs->llvm_value, var->value->type); } - } - LLVMSetGlobalConstant(global_value, var->gen_is_const); + LLVMSetGlobalConstant(global_value, var->gen_is_const); + } var->value_ref = global_value; } |
