mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Change find_or_generator_context_ptr behaviours
This commit is contained in:
@@ -3115,7 +3115,6 @@ irValue *ir_find_or_generate_context_ptr(irProcedure *proc) {
|
|||||||
|
|
||||||
irValue *c = ir_add_local_generated(proc, t_context, true);
|
irValue *c = ir_add_local_generated(proc, t_context, true);
|
||||||
ir_push_context_onto_stack(proc, c);
|
ir_push_context_onto_stack(proc, c);
|
||||||
ir_emit_store(proc, c, ir_emit_load(proc, proc->module->global_default_context));
|
|
||||||
ir_emit_init_context(proc, c);
|
ir_emit_init_context(proc, c);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6039,14 +6039,11 @@ lbAddr lb_find_or_generate_context_ptr(lbProcedure *p) {
|
|||||||
|
|
||||||
Type *pt = base_type(p->type);
|
Type *pt = base_type(p->type);
|
||||||
GB_ASSERT(pt->kind == Type_Proc);
|
GB_ASSERT(pt->kind == Type_Proc);
|
||||||
if (pt->Proc.calling_convention != ProcCC_Odin) {
|
{
|
||||||
return p->module->global_default_context;
|
|
||||||
} else {
|
|
||||||
lbAddr c = lb_add_local_generated(p, t_context, false);
|
lbAddr c = lb_add_local_generated(p, t_context, false);
|
||||||
c.kind = lbAddr_Context;
|
c.kind = lbAddr_Context;
|
||||||
lb_push_context_onto_stack(p, c);
|
|
||||||
lb_addr_store(p, c, lb_addr_load(p, p->module->global_default_context));
|
|
||||||
lb_emit_init_context(p, c);
|
lb_emit_init_context(p, c);
|
||||||
|
lb_push_context_onto_stack(p, c);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user