aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch')
-rw-r--r--recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch b/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch
new file mode 100644
index 0000000000..1c697ef8ab
--- /dev/null
+++ b/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch
@@ -0,0 +1,29 @@
+From fe541bc5cd9d84a567705b72777c2b2117c85aef Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?J=C3=BCrg=20Billeter?= <j@bitron.ch>
+Date: Wed, 30 Sep 2009 19:28:37 +0200
+Subject: [PATCH] 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)));
+--
+1.6.0.4
+