]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix uncaught error's return statement
authorDidier 'Ptitjes <ptitjes@free.fr>
Tue, 9 Jun 2009 09:19:49 +0000 (11:19 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 3 Jul 2009 14:44:39 +0000 (15:44 +0100)
FALSE must be returned in coroutines, independent of the return
type.

Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
codegen/valagerrormodule.vala

index ee93a0965059509fa49b204d1baf474455aef2e9..b8ba1a11e549815b056126b3aa4201e7dfc361e0 100644 (file)
@@ -151,6 +151,8 @@ internal class Vala.GErrorModule : CCodeDelegateModule {
 
                if (current_method is CreationMethod) {
                        cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+               } else if (current_method.coroutine) {
+                       cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("FALSE")));
                } else if (current_return_type is VoidType) {
                        cerror_block.add_statement (new CCodeReturnStatement ());
                } else if (current_return_type != null) {