fix disposing builder when not created

Fixes #5128

p->builder is created in lb_begin_procedure_body, but that isn't called
if there is no body, and we were still calling dispose at that point.

Moved it into lb_end_procedure_body to match.
This commit is contained in:
Laytan Laats
2025-05-07 14:38:40 +02:00
parent 90a30a145a
commit ad4866653a
3 changed files with 1 additions and 4 deletions
-1
View File
@@ -2185,7 +2185,6 @@ gb_internal void lb_generate_procedure(lbModule *m, lbProcedure *p) {
p->is_done = true;
m->curr_procedure = nullptr;
}
lb_end_procedure(p);
// Add Flags
if (p->entity && p->entity->kind == Entity_Procedure && p->entity->Procedure.is_memcpy_like) {