aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-11-01 15:49:10 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2022-11-01 15:49:10 +0100
commit6cc07dc24e4eb9800b1086580d271970b45f77cb (patch)
tree61a2667221360c48e74aed93e1a51deef7b13622 /src/checker.cpp
parent01cdd22a01b4133c791ed1d04ebdf22a044e35b0 (diff)
parent35331e6973280da2a0f9971a33842fb45d311aac (diff)
Merge branch 'master' of github.com:odin-lang/Odin
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 9b2f72205..dd81e2a48 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1673,7 +1673,11 @@ bool could_entity_be_lazy(Entity *e, DeclInfo *d) {
}
void add_entity_and_decl_info(CheckerContext *c, Ast *identifier, Entity *e, DeclInfo *d, bool is_exported) {
- GB_ASSERT(identifier != nullptr);
+ if (identifier == nullptr) {
+ // NOTE(bill): Should only happen on errors
+ error(e->token, "Invalid variable declaration");
+ return;
+ }
if (identifier->kind != Ast_Ident) {
// NOTE(bill): This is a safety check
gbString s = expr_to_string(identifier);