[vala] GError: Fix error propagation in creation methods
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] GError: Fix error propagation in creation methods
- Date: Wed, 30 Sep 2009 17:34:47 +0000 (UTC)
commit fe541bc5cd9d84a567705b72777c2b2117c85aef
Author: Jürg Billeter <j bitron ch>
Date: Wed Sep 30 19:28:37 2009 +0200
GError: Fix error propagation in creation methods
codegen/valagerrormodule.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala
index 9d624de..2f1d385 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -116,7 +116,11 @@ internal class Vala.GErrorModule : CCodeDelegateModule {
append_local_free (current_symbol, free_frag, false);
cerror_block.add_statement (free_frag);
- if (current_return_type is VoidType) {
+ if (current_method is CreationMethod) {
+ cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+ } else if (current_method != null && 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 {
cerror_block.add_statement (new CCodeReturnStatement (default_value_for_type (current_return_type, false)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]