aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-04-17 22:17:16 +0100
committerGinger Bill <bill@gingerbill.org>2017-04-17 22:17:16 +0100
commit813a028ed0c8b3387436d959b4faa924117edab2 (patch)
treecb632dbb45f61c524869bb82127c99c31bd7ec2b /src/check_expr.c
parent0c22081e5f5aef99b702b159d9568d90f661b1e8 (diff)
Fix procedure calls from non-regular addressing modes
Diffstat (limited to 'src/check_expr.c')
-rw-r--r--src/check_expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/check_expr.c b/src/check_expr.c
index e5c88d66a..a60193dae 100644
--- a/src/check_expr.c
+++ b/src/check_expr.c
@@ -4764,11 +4764,13 @@ ExprKind check_call_expr(Checker *c, Operand *operand, AstNode *call) {
Type *proc_type = base_type(operand->type);
if (operand->mode != Addressing_Overload) {
bool valid_type = (proc_type != NULL) && is_type_proc(proc_type);
- bool valid_mode = (operand->mode == Addressing_Value) || (operand->mode == Addressing_Variable);
+ bool valid_mode = is_operand_value(*operand);
if (!valid_type || !valid_mode) {
AstNode *e = operand->expr;
gbString str = expr_to_string(e);
- error_node(e, "Cannot call a non-procedure: `%s` %d", str, operand->mode);
+ gbString type_str = type_to_string(operand->type);
+ error_node(e, "Cannot call a non-procedure: `%s` of type `%s`", str, type_str);
+ gb_string_free(type_str);
gb_string_free(str);
operand->mode = Addressing_Invalid;