aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-25 23:41:46 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-25 23:41:46 +0100
commit362a11878283eea69cf5a18b7f05c964643a7a64 (patch)
treef3fd27c626ccbbfa323530ed5fec495c38dd3a3c /src/checker.cpp
parent3ab481df17d35ac0ac66f0bb619885e43dc060f1 (diff)
Remove "overloading" bug of para-poly-procs
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 7c23843cb..5f5b8a281 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -955,6 +955,9 @@ void add_entity_definition(CheckerInfo *i, AstNode *identifier, Entity *entity)
}
bool add_entity(Checker *c, Scope *scope, AstNode *identifier, Entity *entity) {
+ if (scope == NULL) {
+ return false;
+ }
String name = entity->token.string;
if (name != "_") {
Entity *ie = scope_insert_entity(scope, entity);
@@ -1007,7 +1010,8 @@ void add_entity_and_decl_info(Checker *c, AstNode *identifier, Entity *e, DeclIn
GB_ASSERT(identifier->kind == AstNode_Ident);
GB_ASSERT(e != NULL && d != NULL);
GB_ASSERT(identifier->Ident.string == e->token.string);
- add_entity(c, e->scope, identifier, e);
+ if (e->scope != NULL) add_entity(c, e->scope, identifier, e);
+ add_entity_definition(&c->info, identifier, e);
map_set(&c->info.entities, hash_entity(e), d);
}