Fix BigInt normalization issue #293

This commit is contained in:
gingerBill
2018-12-08 11:25:35 +00:00
parent ff6ec860b3
commit bd62bceca6
3 changed files with 28 additions and 6 deletions

View File

@@ -1647,6 +1647,13 @@ void check_comparison(CheckerContext *c, Operand *x, Operand *y, TokenKind op) {
}
}
} else {
if (is_type_integer(x->type)) {
i64 i = exact_value_to_i64(x->value);
if (i == 0) {
auto bi = x->value.value_integer;
gb_printf_err("%s %d %lld\n", expr_to_string(x->expr), bi.len, bi.d.word);
}
}
x->value = exact_value_bool(compare_exact_values(op, x->value, y->value));
}
} else {