Correct a race condition when checking the procedure body

This commit is contained in:
gingerBill
2023-01-02 15:30:04 +00:00
parent f01cff7ff0
commit 529383f5b1
12 changed files with 262 additions and 68 deletions
+4 -1
View File
@@ -2714,7 +2714,6 @@ gb_internal lbValue lb_find_value_from_entity(lbModule *m, Entity *e) {
return g;
}
}
GB_PANIC("\n\tError in: %s, missing value '%.*s'\n", token_pos_to_string(e->token.pos), LIT(e->token.string));
return {};
}
@@ -2845,6 +2844,10 @@ gb_internal lbAddr lb_add_local(lbProcedure *p, Type *type, Entity *e, bool zero
lb_mem_zero_ptr(p, ptr, type, alignment);
}
if (e != nullptr) {
map_set(&p->local_entity_map, e, val);
}
return lb_addr(val);
}