Skip to content

Commit 7d8f41b

Browse files
authored
Merge pull request #5379 from Feoramund/fix-4711
Push `context` onto stack before evaluating procedure parameters
2 parents 30e1c96 + 378e72b commit 7d8f41b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/llvm_backend_proc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
546546
GB_ASSERT(p->type != nullptr);
547547

548548
lb_ensure_abi_function_type(p->module, p);
549+
if (p->type->Proc.calling_convention == ProcCC_Odin) {
550+
lb_push_context_onto_stack_from_implicit_parameter(p);
551+
}
549552
{
550553
lbFunctionType *ft = p->abi_function_type;
551554

@@ -743,9 +746,6 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
743746

744747
}
745748
}
746-
if (p->type->Proc.calling_convention == ProcCC_Odin) {
747-
lb_push_context_onto_stack_from_implicit_parameter(p);
748-
}
749749

750750
lb_set_debug_position_to_procedure_begin(p);
751751
if (p->debug_info != nullptr) {

0 commit comments

Comments
 (0)