aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-08-26 02:36:18 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-08-26 02:36:18 -0400
commit8047f0eae2da64a88474dbe9106c61b3e26e6871 (patch)
tree6e67a5ac7d615580ac2c5114c2326cc23336574f /src/codegen.cpp
parent526338b00fbe1cac19f64832176af3bdf2108a56 (diff)
downloadzig-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.cpp5
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;
}