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 -2
View File
@@ -783,8 +783,7 @@ gb_internal void lb_end_procedure_body(lbProcedure *p) {
p->curr_block = nullptr;
p->state_flags = 0;
}
gb_internal void lb_end_procedure(lbProcedure *p) {
LLVMDisposeBuilder(p->builder);
}