From b54b5aabac1c141411cd626f816ea144f559f5d3 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 4 Apr 2020 19:45:54 +0100 Subject: Fix crash on aliasing compiler-only packages (e.g. intrinsics) with `_` at the global scope. --- src/check_decl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 13f05c5b5..09ad3508c 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -335,6 +335,9 @@ void override_entity_in_scope(Entity *original_entity, Entity *new_entity) { Scope *found_scope = nullptr; Entity *found_entity = nullptr; scope_lookup_parent(original_entity->scope, original_name, &found_scope, &found_entity); + if (found_scope == nullptr) { + return; + } // IMPORTANT TODO(bill) // Date: 2018-09-29 -- cgit v1.2.3