mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix ICE on missing procedure in base:runtime
When a required built-in procedure is missing from the base:runtime package, an assert should be triggered. However this does not happen and instead the compiler crashes silently. The cause is the null-dereference after scope_lookup_current returns nullptr. This adds an assertion that the runtime procedure is found, before proceeding to check it's type and performing further lookups.
This commit is contained in:
@@ -2792,6 +2792,7 @@ gb_internal lbValue lb_find_ident(lbProcedure *p, lbModule *m, Entity *e, Ast *e
|
|||||||
gb_internal lbValue lb_find_procedure_value_from_entity(lbModule *m, Entity *e) {
|
gb_internal lbValue lb_find_procedure_value_from_entity(lbModule *m, Entity *e) {
|
||||||
lbGenerator *gen = m->gen;
|
lbGenerator *gen = m->gen;
|
||||||
|
|
||||||
|
GB_ASSERT(e != nullptr);
|
||||||
GB_ASSERT(is_type_proc(e->type));
|
GB_ASSERT(is_type_proc(e->type));
|
||||||
e = strip_entity_wrapping(e);
|
e = strip_entity_wrapping(e);
|
||||||
GB_ASSERT(e != nullptr);
|
GB_ASSERT(e != nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user