[vala/0.50] vala: Report error for invalid inner operand of unary expressions
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.50] vala: Report error for invalid inner operand of unary expressions
- Date: Sun, 28 Feb 2021 08:58:23 +0000 (UTC)
commit dc1001f732e10ed4d2a496dc8f156b83251aae88
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Feb 27 12:23:56 2021 +0100
vala: Report error for invalid inner operand of unary expressions
This fixes criticals like:
vala_unary_expression_is_integer_type: assertion 'type != NULL' failed
vala/valaunaryexpression.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index a97c0b204..bf14f6207 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -158,6 +158,10 @@ public class Vala.UnaryExpression : Expression {
/* if there was an error in the inner expression, skip type check */
error = true;
return false;
+ } else if (inner.value_type == null) {
+ error = true;
+ Report.error (inner.source_reference, "Invalid inner operand");
+ return false;
}
if (inner.value_type is FieldPrototype || inner.value_type is PropertyPrototype) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]