aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-02-17 18:34:14 +0000
committergingerBill <bill@gingerbill.org>2018-02-17 18:34:14 +0000
commit21432ba96efc2622f12b2939a0e5d9c2baa0d2c2 (patch)
treee960d1eaf535e4b5a4d89be1dfecd11ed1966aa6 /src/check_stmt.cpp
parentc341597657d92834209b720efc54011bf0179828 (diff)
Clean up range code for switch
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);