Fix issue #244 with constant array comparisons

This commit is contained in:
gingerBill
2018-08-14 19:43:36 +01:00
parent 59da98d3f0
commit 1ee60663bb

View File

@@ -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;