summaryrefslogtreecommitdiff
path: root/codegen/valaccodemethodmodule.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-03-13 09:11:01 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-03-13 13:18:29 +0100
commitc12529b7bd51640bbcc9b96bf84be7e0897c2ba1 (patch)
treed22f66ae2d7d6f91ca1e953c17ad4845be356b29 /codegen/valaccodemethodmodule.vala
parent4555ed66dcf5839e79e3b9a62ef5cf83bde35d4e (diff)
downloadvala-c12529b7bd51640bbcc9b96bf84be7e0897c2ba1.tar.gz
codegen: Correctly access captured parameter in precondition of method
Fixes https://gitlab.gnome.org/GNOME/vala/issues/144
Diffstat (limited to 'codegen/valaccodemethodmodule.vala')
-rw-r--r--codegen/valaccodemethodmodule.vala3
1 files changed, 3 insertions, 0 deletions
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 1062ad408..404a6153a 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -1152,6 +1152,8 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
}
private void create_precondition_statement (Method m, DataType ret_type, Expression precondition) {
+ is_in_method_precondition = true;
+
var ccheck = new CCodeFunctionCall ();
precondition.emit (this);
@@ -1191,6 +1193,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
ccode.add_expression (ccheck);
current_method_return = true;
+ is_in_method_precondition = false;
}
public override void visit_creation_method (CreationMethod m) {