From: Juerg Billeter Date: Fri, 14 Dec 2007 15:42:21 +0000 (+0000) Subject: fix exception handling with ellipsis parameters X-Git-Tag: VALA_0_1_6~100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10727f6e237a38bec4024393091d73c177c8fe89;p=platform%2Fupstream%2Fvala.git 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 --- 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")));