]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix preconditions in asynchronous methods
authorJürg Billeter <j@bitron.ch>
Fri, 3 Sep 2010 14:55:44 +0000 (16:55 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 4 Sep 2010 14:58:37 +0000 (16:58 +0200)
codegen/valaccodemethodmodule.vala

index 0df172f5f973b42469c0ade5fd592d466879c2c0..4232ab437bcefe9cd268a8555a3d073790056d96 100644 (file)
@@ -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");