diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 8fdd5372b..4e791af16 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -12128,12 +12128,12 @@ gb_internal bool is_exact_value_zero(ExactValue const &v) { -gb_internal bool compare_exact_values_compound_lit(TokenKind op, ExactValue x, ExactValue y, bool *do_break_) { +gb_internal bool compare_exact_values_compound_lit(TokenKind op, ExactValue x, ExactValue y) { ast_node(x_cl, CompoundLit, x.value_compound); ast_node(y_cl, CompoundLit, y.value_compound); if (x_cl->elems.count != y_cl->elems.count) { - if (do_break_) *do_break_ = true; + return false; } bool test = op == Token_CmpEq; diff --git a/src/exact_value.cpp b/src/exact_value.cpp index f266b8b24..0f425e043 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -947,7 +947,7 @@ gb_internal gb_inline i32 cmp_f64(f64 a, f64 b) { return (a > b) - (a < b); } -gb_internal bool compare_exact_values_compound_lit(TokenKind op, ExactValue x, ExactValue y, bool *do_break_); +gb_internal bool compare_exact_values_compound_lit(TokenKind op, ExactValue x, ExactValue y); gb_internal bool compare_exact_values(TokenKind op, ExactValue x, ExactValue y) { match_exact_values(&x, &y); @@ -1060,18 +1060,13 @@ gb_internal bool compare_exact_values(TokenKind op, ExactValue x, ExactValue y) case ExactValue_Compound: if (op != Token_CmpEq && op != Token_NotEq) { - break; + return false; } if (x.kind != y.kind) { - break; + return false; } - bool do_break = false; - bool res = compare_exact_values_compound_lit(op, x, y, &do_break); - if (do_break) { - break; - } - return res; + return compare_exact_values_compound_lit(op, x, y); } GB_PANIC("Invalid comparison: %d", x.kind);