aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorSunagatov Denis <thebumboni@gmail.com>2025-08-08 03:18:57 +1100
committerSunagatov Denis <thebumboni@gmail.com>2025-08-08 03:30:15 +1100
commit46b7abee9fdd339bac31fe7bc79551f2b3881f46 (patch)
treeed526c1a7d103e19b2e93fa1d25d34a2edd11bda /src/llvm_backend_general.cpp
parent8d89b1a4489adf0a0ae88302cbb9674d8de0b231 (diff)
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.
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 5d6a55973..67e799918 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -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);