Clean up big int to LLVM integer code

This commit is contained in:
gingerBill
2021-07-11 16:18:30 +01:00
parent e90e7d4af9
commit 63b572a0ab
5 changed files with 48 additions and 68 deletions

View File

@@ -2242,7 +2242,7 @@ void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *node, Type *typ
}
}
if (y->mode == Addressing_Constant && y->value.value_integer.sign) {
if (y->mode == Addressing_Constant && big_int_is_neg(&y->value.value_integer)) {
gbString err_str = expr_to_string(y->expr);
error(node, "Shift amount cannot be negative: '%s'", err_str);
gb_string_free(err_str);