fix passing pointer to constant in non-odin cc
This commit is contained in:
1 parent
a0b1b8d1c3
commit
2a526058b3
1 file changed
+1
-9
@@ -1097,15 +1097,7 @@ gb_internal lbValue lb_emit_call(lbProcedure *p, lbValue value, Array<lbValue> c
|
||||
ptr = lb_address_from_load_or_generate_local(p, x);
|
||||
}
|
||||
} else {
|
||||
if (LLVMIsConstant(x.value)) {
|
||||
// NOTE(bill): if the value is already constant, then just it as a global variable
|
||||
// and pass it by pointer
|
||||
lbAddr addr = lb_add_global_generated(p->module, original_type, x);
|
||||
lb_make_global_private_const(addr);
|
||||
ptr = addr.addr;
|
||||
} else {
|
||||
ptr = lb_copy_value_to_ptr(p, x, original_type, 16);
|
||||
}
|
||||
ptr = lb_copy_value_to_ptr(p, x, original_type, 16);
|
||||
}
|
||||
array_add(&processed_args, ptr);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user