summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-12-15 17:26:52 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-12-15 17:26:52 -0500
commit054fec911b18dc0c8ec0180858b0bd00f60be90b (patch)
tree1d27f15bdc345044ea293e8c5ff3da6cda439861 /eval.c
parente637aa3a416e0c90273f127a8d11b918356dfcc4 (diff)
bug fixes for inference
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 02f6327..3b0ec71 100644
--- a/eval.c
+++ b/eval.c
@@ -1323,6 +1323,12 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) {
break;
case EXPR_IDENT: {
IdentDecl *idecl = ident_decl(e->ident);
+ if (!idecl) {
+ char *s = ident_to_str(e->ident);
+ err_print(e->where, "Undeclared identifier: %s.", s);
+ free(s);
+ return false;
+ }
bool is_decl = idecl->kind == IDECL_DECL;
Declaration *d = NULL;
if (is_decl) {