aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-06 17:23:33 +0000
committergingerBill <bill@gingerbill.org>2021-11-06 17:23:33 +0000
commit3d3785a7f1535cfa213f074704085f42ae02638a (patch)
treef7387a64a44d747b02b3a1ff481e9cbbd969abd2 /src/llvm_backend.cpp
parent5df15b5724e1c25366d39b4bbb2f24b33068d5f6 (diff)
Remove many LLVM optimization passes which were causes UB due to them assuming C-like behaviour incompatible with Odin
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index dbe780284..c002bfc5e 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -684,7 +684,8 @@ lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProcedure *start
if (init.value == nullptr) {
LLVMTypeRef global_type = LLVMGetElementType(LLVMTypeOf(var->var.value));
if (is_type_untyped_undef(init.type)) {
- LLVMSetInitializer(var->var.value, LLVMGetUndef(global_type));
+ // LLVMSetInitializer(var->var.value, LLVMGetUndef(global_type));
+ LLVMSetInitializer(var->var.value, LLVMConstNull(global_type));
var->is_initialized = true;
continue;
} else if (is_type_untyped_nil(init.type)) {