summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-02-27 12:23:56 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2021-02-27 20:26:43 +0100
commitdc1001f732e10ed4d2a496dc8f156b83251aae88 (patch)
treed54531c372f5412d8db6647b8a669d11a86d3fdb
parent077157d9628f83d0b668cd426fd9fede973ed477 (diff)
downloadvala-dc1001f732e10ed4d2a496dc8f156b83251aae88.tar.gz
vala: Report error for invalid inner operand of unary expressions
This fixes criticals like: vala_unary_expression_is_integer_type: assertion 'type != NULL' failed
-rw-r--r--vala/valaunaryexpression.vala4
1 files changed, 4 insertions, 0 deletions
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) {