mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-20 04:35:00 -07:00
Enforce constant pointer cast on global procedure variable initialization x := proc() {}
This commit is contained in:
@@ -780,6 +780,9 @@ lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProcedure *start
|
||||
var->init = init;
|
||||
} else if (lb_is_const_or_global(init)) {
|
||||
if (!var->is_initialized) {
|
||||
if (is_type_proc(init.type)) {
|
||||
init.value = LLVMConstPointerCast(init.value, lb_type(p->module, init.type));
|
||||
}
|
||||
LLVMSetInitializer(var->var.value, init.value);
|
||||
var->is_initialized = true;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user