aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-08-14 19:43:36 +0100
committergingerBill <bill@gingerbill.org>2018-08-14 19:43:36 +0100
commit1ee60663bb9a6d3b5a5effb3028679928c77fa1a (patch)
tree2a36982be62565c0f8107db0ccb77bd5c466a37a
parent59da98d3f0a36e70027a1aebc0ed22168dff62c7 (diff)
Fix issue #244 with constant array comparisons
-rw-r--r--src/check_expr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 9629a3e34..917e79dc7 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -1553,7 +1553,11 @@ void check_comparison(CheckerContext *c, Operand *x, Operand *y, TokenKind op) {
} else {
if (x->mode == Addressing_Constant &&
y->mode == Addressing_Constant) {
- x->value = exact_value_bool(compare_exact_values(op, x->value, y->value));
+ if (is_type_constant_type(x->type)) {
+ x->value = exact_value_bool(compare_exact_values(op, x->value, y->value));
+ } else {
+ x->mode = Addressing_Value;
+ }
} else {
x->mode = Addressing_Value;