diff options
| author | gingerBill <bill@gingerbill.org> | 2023-05-22 12:53:29 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-05-22 12:53:29 +0100 |
| commit | 8bf32ac697ea21ff3b37e5b31fe0fc10e700c9a4 (patch) | |
| tree | 77e96ea43b5faf78d81ca1d8158db59fe3e24add /src/llvm_backend.cpp | |
| parent | 540f724b1f57d0d5a40b65a59f6ee82e070c6ee5 (diff) | |
Minor change to handling of propagation of errors with `---` as a value
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 4d8e13f0f..15a0a0b56 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -1129,12 +1129,7 @@ gb_internal lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProc lbValue init = lb_build_expr(p, init_expr); if (init.value == nullptr) { LLVMTypeRef global_type = llvm_addr_type(p->module, var.var); - if (is_type_untyped_undef(init.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)) { + if (is_type_untyped_nil(init.type)) { LLVMSetInitializer(var.var.value, LLVMConstNull(global_type)); var.is_initialized = true; continue; @@ -2363,8 +2358,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) { } } } - if (!var.is_initialized && - (is_type_untyped_nil(tav.type) || is_type_untyped_undef(tav.type))) { + if (!var.is_initialized && is_type_untyped_nil(tav.type)) { var.is_initialized = true; } } |