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:
Sunagatov Denis
2025-08-08 03:18:57 +11:00
parent 8d89b1a448
commit 46b7abee9f

View File

@@ -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) {
lbGenerator *gen = m->gen;
GB_ASSERT(e != nullptr);
GB_ASSERT(is_type_proc(e->type));
e = strip_entity_wrapping(e);
GB_ASSERT(e != nullptr);