diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-12-15 17:26:52 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-12-15 17:26:52 -0500 |
commit | 054fec911b18dc0c8ec0180858b0bd00f60be90b (patch) | |
tree | 1d27f15bdc345044ea293e8c5ff3da6cda439861 /eval.c | |
parent | e637aa3a416e0c90273f127a8d11b918356dfcc4 (diff) |
bug fixes for inference
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) { |