diff options
| author | gingerBill <bill@gingerbill.org> | 2022-08-26 12:14:04 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-08-26 12:14:04 +0100 |
| commit | 8fd5bef0bd3dd149219acb866b717f80dd7b8061 (patch) | |
| tree | 652159cad92b444e65e543306b2844b21e6d1324 /src/check_stmt.cpp | |
| parent | d6b49994a295c507a7b0e60422f52a53df71a9a0 (diff) | |
Fix #1977
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 884c7b5ae..d741ceabf 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1464,6 +1464,12 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { AstSelectorCallExpr *se = &expr->SelectorCallExpr; ast_node(ce, CallExpr, se->call); Type *t = base_type(type_of_expr(ce->proc)); + if (t == nullptr) { + gbString expr_str = expr_to_string(ce->proc); + error(node, "'%s' is not a value field nor procedure", expr_str); + gb_string_free(expr_str); + return; + } if (t->kind == Type_Proc) { do_require = t->Proc.require_results; } else if (check_stmt_internal_builtin_proc_id(ce->proc, &builtin_id)) { |