Minor change to lb_emit_store for storing nil to procedure variables
This commit is contained in:
1 parent
cb0a59bb2c
commit
ff94c605e0
1 file changed
+3
-1
@@ -853,7 +853,9 @@ void lb_emit_store(lbProcedure *p, lbValue ptr, lbValue value) {
|
|||||||
|
|
||||||
if (LLVMIsNull(value.value)) {
|
if (LLVMIsNull(value.value)) {
|
||||||
LLVMTypeRef src_t = llvm_addr_type(p->module, ptr);
|
LLVMTypeRef src_t = llvm_addr_type(p->module, ptr);
|
||||||
if (lb_sizeof(src_t) <= lb_max_zero_init_size()) {
|
if (is_type_proc(a)) {
|
||||||
|
LLVMBuildStore(p->builder, LLVMConstNull(llvm_get_element_type(LLVMTypeOf(ptr.value))), ptr.value);
|
||||||
|
} else if (lb_sizeof(src_t) <= lb_max_zero_init_size()) {
|
||||||
LLVMBuildStore(p->builder, LLVMConstNull(src_t), ptr.value);
|
LLVMBuildStore(p->builder, LLVMConstNull(src_t), ptr.value);
|
||||||
} else {
|
} else {
|
||||||
lb_mem_zero_ptr(p, ptr.value, a, 1);
|
lb_mem_zero_ptr(p, ptr.value, a, 1);
|
||||||
|
|||||||
Reference in new issue
Block a user