fix exception handling with ellipsis parameters
authorJuerg Billeter <j@bitron.ch>
Fri, 14 Dec 2007 15:42:21 +0000 (15:42 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 14 Dec 2007 15:42:21 +0000 (15:42 +0000)
2007-12-14  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodegeneratorinvocationexpression.vala: fix exception
  handling with ellipsis parameters

svn path=/trunk/; revision=767

ChangeLog
gobject/valaccodegeneratorinvocationexpression.vala

index 641586a..0ab00a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-14  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodegeneratorinvocationexpression.vala: fix exception
+         handling with ellipsis parameters
+
 2007-12-12  Jürg Billeter  <j@bitron.ch>
 
        * vala/valasymbolresolver.vala: readd support for void UnresolvedType,
index 4ba7048..c522cf0 100644 (file)
@@ -242,6 +242,10 @@ public class Vala.CCodeGenerator {
                                                        }
                                                }
                                        }
+                               } else if (expr.can_fail && !(m is DBusMethod)) {
+                                       // method can fail
+                                       current_method_inner_error = true;
+                                       ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("inner_error")));
                                }
                        }
                                        
@@ -253,6 +257,11 @@ public class Vala.CCodeGenerator {
                        
                        if (param.ellipsis) {
                                ellipsis = true;
+                               if (expr.can_fail && !(m is DBusMethod)) {
+                                       // method can fail
+                                       current_method_inner_error = true;
+                                       ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("inner_error")));
+                               }
                                break;
                        }
                        
@@ -305,7 +314,7 @@ public class Vala.CCodeGenerator {
                        ccall.add_argument (new CCodeIdentifier ("G_TYPE_INVALID"));
                }
 
-               if (expr.can_fail && !(m is DBusMethod)) {
+               if (!ellipsis && expr.can_fail && !(m is DBusMethod)) {
                        // method can fail
                        current_method_inner_error = true;
                        ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("inner_error")));