aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 7d053dee6..a8208b7dd 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -744,9 +744,9 @@ void check_switch_stmt(Checker *c, AstNode *node, u32 mod_flags) {
}
}
- if (a1.mode != Addressing_Invalid &&
+ if (a1.mode != Addressing_Invalid && b1.mode != Addressing_Invalid &&
lhs.mode == Addressing_Constant && rhs.mode == Addressing_Constant &&
- !is_type_string(lhs.type) && !is_type_string(rhs.type)) {
+ is_type_number(lhs.type) && is_type_number(rhs.type)) {
ExactValue start = lhs.value;
ExactValue end = rhs.value;
ExactValue one = exact_value_i64(1);