[vala] codegen: Fix preconditions in asynchronous methods



commit 50879438fd227ba913986397163970caf164c775
Author: Jürg Billeter <j bitron ch>
Date:   Fri Sep 3 16:55:44 2010 +0200

    codegen: Fix preconditions in asynchronous methods

 codegen/valaccodemethodmodule.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index cef50c6..a1d54d7 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -972,6 +972,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");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]