From: Jürg Billeter Date: Fri, 3 Sep 2010 14:55:44 +0000 (+0200) Subject: codegen: Fix preconditions in asynchronous methods X-Git-Tag: 0.9.8~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f728c60a39396df162b525cd5354b58e1871abc;p=thirdparty%2Fvala.git codegen: Fix preconditions in asynchronous methods --- diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 0df172f5f..4232ab437 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -1010,6 +1010,10 @@ public class Vala.CCodeMethodModule : CCodeStructModule { if (method_node is CreationMethod) { ccheck.call = new CCodeIdentifier ("g_return_val_if_fail"); ccheck.add_argument (new CCodeConstant ("NULL")); + } else if (method_node is Method && ((Method) method_node).coroutine) { + // _co function + ccheck.call = new CCodeIdentifier ("g_return_val_if_fail"); + ccheck.add_argument (new CCodeConstant ("FALSE")); } else if (ret_type is VoidType) { /* void function */ ccheck.call = new CCodeIdentifier ("g_return_if_fail");