]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Report error for unsupported operator instead of assertion 75a87e25b65ed91f566a0b82cc0fd9ef76d8421b
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 27 Mar 2019 08:55:31 +0000 (09:55 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 27 Mar 2019 08:55:31 +0000 (09:55 +0100)
vala/valaassignment.vala
vala/valabinaryexpression.vala

index 183ea57be17695bedb8538c05c2fa1682ee7661b..9db0ec1634e8c305e02efd9f8d4313ea3bfe05f9 100644 (file)
@@ -246,7 +246,10 @@ public class Vala.Assignment : Expression {
                        case AssignmentOperator.PERCENT: bop = BinaryOperator.MOD; break;
                        case AssignmentOperator.SHIFT_LEFT: bop = BinaryOperator.SHIFT_LEFT; break;
                        case AssignmentOperator.SHIFT_RIGHT: bop = BinaryOperator.SHIFT_RIGHT; break;
-                       default: assert_not_reached ();
+                       default:
+                               error = true;
+                               Report.error (source_reference, "internal error: unsupported assignment operator");
+                               return false;
                        }
 
                        var bin = new BinaryExpression (bop, old_value, right, source_reference);
index eb1ea1b8c45c5d5b7b00698e3bea3e5b79bf8202..f21aa42c002ecc6d3b800e629086ce6a04241486 100644 (file)
@@ -545,7 +545,9 @@ public class Vala.BinaryExpression : Expression {
                        value_type = context.analyzer.bool_type;
 
                } else {
-                       assert_not_reached ();
+                       error = true;
+                       Report.error (source_reference, "internal error: unsupported binary operator");
+                       return false;
                }
 
                value_type.check (context);