aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-10-29 20:43:02 +0000
committergingerBill <bill@gingerbill.org>2023-10-29 20:43:02 +0000
commitd589914956fa6afb150e5ddbf52fc697e50df814 (patch)
tree01c4793722c2443545c79f0e89db526b7260333b /src
parentf54a026accb34a22680256cdfdf9e366daff28b2 (diff)
Ignore `store undef` calls
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend_general.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 0f0df7ca5..fdcf94f29 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -962,8 +962,12 @@ gb_internal bool lb_is_type_proc_recursive(Type *t) {
gb_internal void lb_emit_store(lbProcedure *p, lbValue ptr, lbValue value) {
GB_ASSERT(value.value != nullptr);
- Type *a = type_deref(ptr.type);
+ if (LLVMIsUndef(value.value)) {
+ return;
+ }
+
+ Type *a = type_deref(ptr.type);
if (LLVMIsNull(value.value)) {
LLVMTypeRef src_t = llvm_addr_type(p->module, ptr);
if (is_type_proc(a)) {