From 10727f6e237a38bec4024393091d73c177c8fe89 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Fri, 14 Dec 2007 15:42:21 +0000 Subject: [PATCH] fix exception handling with ellipsis parameters 2007-12-14 Juerg Billeter * gobject/valaccodegeneratorinvocationexpression.vala: fix exception handling with ellipsis parameters svn path=/trunk/; revision=767 --- ChangeLog | 5 +++++ gobject/valaccodegeneratorinvocationexpression.vala | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 641586a..0ab00a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-14 Jürg Billeter + + * gobject/valaccodegeneratorinvocationexpression.vala: fix exception + handling with ellipsis parameters + 2007-12-12 Jürg Billeter * vala/valasymbolresolver.vala: readd support for void UnresolvedType, diff --git a/gobject/valaccodegeneratorinvocationexpression.vala b/gobject/valaccodegeneratorinvocationexpression.vala index 4ba7048..c522cf0 100644 --- a/gobject/valaccodegeneratorinvocationexpression.vala +++ b/gobject/valaccodegeneratorinvocationexpression.vala @@ -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"))); -- 2.7.4