[vala/staging: 2/7] codegen: Avoid early return on sync dbus methods returning an error



commit 00d0c7d659adee4a9388acfc478ae4f55fb6d29f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 6 13:17:40 2017 +0100

    codegen: Avoid early return on sync dbus methods returning an error
    
    If there are arguments that need freeing, we need to fall through the
    _error label, if there is any.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778540

 codegen/valagdbusservermodule.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala
index 2cb4271..d0c87fd 100644
--- a/codegen/valagdbusservermodule.vala
+++ b/codegen/valagdbusservermodule.vala
@@ -240,7 +240,11 @@ public class Vala.GDBusServerModule : GDBusClientModule {
                                return_error.add_argument (new CCodeIdentifier ("error"));
                                ccode.add_expression (return_error);
 
-                               ccode.add_return ();
+                               if (need_goto_label) {
+                                       ccode.add_goto ("_error");
+                               } else {
+                                       ccode.add_return ();
+                               }
 
                                ccode.close ();
                        }


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