diff options
| author | gingerBill <bill@gingerbill.org> | 2023-02-22 21:50:49 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-02-22 21:50:49 +0000 |
| commit | 6a6d7701f9892a3468c74f0c7d1e70e04f529824 (patch) | |
| tree | 70993a871c026a9f85520c24b98909f90d08a7d4 /src/check_expr.cpp | |
| parent | b7d75e2f1d3c2b9f14d38aa226fd4c62ca71e403 (diff) | |
Improve error bounds for `check_comparison`
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index f42483c86..00d394966 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2397,7 +2397,7 @@ gb_internal void add_comparison_procedures_for_fields(CheckerContext *c, Type *t } -gb_internal void check_comparison(CheckerContext *c, Operand *x, Operand *y, TokenKind op) { +gb_internal void check_comparison(CheckerContext *c, Ast *node, Operand *x, Operand *y, TokenKind op) { if (x->mode == Addressing_Type && y->mode == Addressing_Type) { bool comp = are_types_identical(x->type, y->type); switch (op) { @@ -2485,7 +2485,7 @@ gb_internal void check_comparison(CheckerContext *c, Operand *x, Operand *y, Tok } if (err_str != nullptr) { - error(x->expr, "Cannot compare expression, %s", err_str); + error(node, "Cannot compare expression, %s", err_str); x->type = t_untyped_bool; } else { if (x->mode == Addressing_Constant && @@ -3498,7 +3498,7 @@ gb_internal void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, Typ if (token_is_comparison(op.kind)) { - check_comparison(c, x, y, op.kind); + check_comparison(c, node, x, y, op.kind); return; } |