From: Juerg Billeter Date: Sun, 6 Apr 2008 19:24:58 +0000 (+0000) Subject: fix crash when using string arrays in parameters of D-Bus methods, fixes X-Git-Tag: VALA_0_2_0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1242bbb030762ccca8a306eff5d908dcd25ff530;p=thirdparty%2Fvala.git fix crash when using string arrays in parameters of D-Bus methods, fixes 2008-04-06 Juerg Billeter * gobject/valaccodegeneratorinvocationexpression.vala: fix crash when using string arrays in parameters of D-Bus methods, fixes bug 525166 svn path=/trunk/; revision=1167 --- diff --git a/ChangeLog b/ChangeLog index a90f5bee4..8c3b47f51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-06 Jürg Billeter + + * gobject/valaccodegeneratorinvocationexpression.vala: fix crash + when using string arrays in parameters of D-Bus methods, + fixes bug 525166 + 2008-04-06 Jürg Billeter * gobject/valaccodegenerator.vala, diff --git a/gobject/valaccodegeneratorinvocationexpression.vala b/gobject/valaccodegeneratorinvocationexpression.vala index 97d952a3f..349766e65 100644 --- a/gobject/valaccodegeneratorinvocationexpression.vala +++ b/gobject/valaccodegeneratorinvocationexpression.vala @@ -174,14 +174,16 @@ public class Vala.CCodeGenerator { var cdecl = new CCodeDeclaration (param.type_reference.get_cname ()); cdecl.add_declarator (new CCodeVariableDeclarator (param.name)); cb_fun.block.add_statement (cdecl); - cend_call.add_argument (new CCodeIdentifier (param.type_reference.data_type.get_type_id ())); - cend_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (param.name))); if (param.type_reference is ArrayType && ((ArrayType) param.type_reference).element_type.data_type == string_type.data_type) { // special case string array + cend_call.add_argument (new CCodeIdentifier ("G_TYPE_STRV")); var cstrvlen = new CCodeFunctionCall (new CCodeIdentifier ("g_strv_length")); cstrvlen.add_argument (new CCodeIdentifier (param.name)); creply_call.add_argument (cstrvlen); + } else { + cend_call.add_argument (new CCodeIdentifier (param.type_reference.data_type.get_type_id ())); } + cend_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (param.name))); creply_call.add_argument (new CCodeIdentifier (param.name)); } }