diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-02-18 18:35:40 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-02-18 18:51:41 +0100 |
commit | dfe4f15616ca0613ed87b6d19fb4a968db258421 (patch) | |
tree | 5e2682474c2fc48360e33374dc241c94184e6208 /vala/valamethodcall.vala | |
parent | 94911d12799c38f95fa5c1a531304ec9c6f136fe (diff) | |
download | vala-dfe4f15616ca0613ed87b6d19fb4a968db258421.tar.gz |
vala: Don't process arguments of MethodCall if error is set
This caused criticals like:
vala_method_get_closure: assertion 'self != NULL' failed
Diffstat (limited to 'vala/valamethodcall.vala')
-rw-r--r-- | vala/valamethodcall.vala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index b9772fed8..4a15a6cb4 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -473,7 +473,10 @@ public class Vala.MethodCall : Expression { bool force_lambda_method_closure = false; foreach (Expression arg in argument_list) { - arg.check (context); + if (!arg.check (context)) { + error = true; + continue; + } if (arg is LambdaExpression && ((LambdaExpression) arg).method.closure) { force_lambda_method_closure = true; @@ -481,7 +484,7 @@ public class Vala.MethodCall : Expression { } // force all lambda arguments using the same closure scope // TODO https://gitlab.gnome.org/GNOME/vala/issues/59 - if (force_lambda_method_closure) { + if (!error && force_lambda_method_closure) { foreach (Expression arg in argument_list) { unowned LambdaExpression? lambda = arg as LambdaExpression; if (lambda != null && lambda.method.binding != MemberBinding.STATIC) { |