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_stmt.cpp | |
| parent | b7d75e2f1d3c2b9f14d38aa226fd4c62ca71e403 (diff) | |
Improve error bounds for `check_comparison`
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index f300f45c7..7e3948336 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -978,19 +978,19 @@ gb_internal void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags Operand a = lhs; Operand b = rhs; - check_comparison(ctx, &a, &x, Token_LtEq); + check_comparison(ctx, expr, &a, &x, Token_LtEq); if (a.mode == Addressing_Invalid) { continue; } - check_comparison(ctx, &b, &x, upper_op); + check_comparison(ctx, expr, &b, &x, upper_op); if (b.mode == Addressing_Invalid) { continue; } Operand a1 = lhs; Operand b1 = rhs; - check_comparison(ctx, &a1, &b1, Token_LtEq); + check_comparison(ctx, expr, &a1, &b1, Token_LtEq); add_to_seen_map(ctx, &seen, upper_op, x, lhs, rhs); @@ -1029,7 +1029,7 @@ gb_internal void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags // NOTE(bill): the ordering here matters Operand z = y; - check_comparison(ctx, &z, &x, Token_CmpEq); + check_comparison(ctx, expr, &z, &x, Token_CmpEq); if (z.mode == Addressing_Invalid) { continue; } |