From 9672f15a6ea1647a97d8604ce9cc4d6e6fbd53b3 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Tue, 21 Aug 2007 11:23:08 +0000 Subject: [PATCH] add array length argument when passing null as array argument, fixes bug 2007-08-21 Juerg Billeter * gobject/valacodegeneratorinvocationexpression.vala: add array length argument when passing null as array argument, fixes bug 467903 svn path=/trunk/; revision=496 --- ChangeLog | 5 +++++ gobject/valacodegeneratorinvocationexpression.vala | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 192a6f9..91417dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-08-21 Jürg Billeter + * gobject/valacodegeneratorinvocationexpression.vala: add array length + argument when passing null as array argument, fixes bug 467903 + +2007-08-21 Jürg Billeter + * gee/Makefile.am, vala/Makefile.am, ccode/Makefile.am, gobject/Makefile.am, compiler/Makefile.am, tests/Makefile.am, tests/testrunner.sh: fix build system to pass distcheck, diff --git a/gobject/valacodegeneratorinvocationexpression.vala b/gobject/valacodegeneratorinvocationexpression.vala index 96699ab..a4e40e2 100644 --- a/gobject/valacodegeneratorinvocationexpression.vala +++ b/gobject/valacodegeneratorinvocationexpression.vala @@ -227,15 +227,14 @@ public class Vala.CodeGenerator { ellipsis = param.ellipsis; if (!ellipsis) { if (param.type_reference.data_type != null - && param.type_reference.data_type.is_reference_type () - && arg.static_type.data_type != null) { + && param.type_reference.data_type.is_reference_type ()) { if (!param.no_array_length && param.type_reference.data_type is Array) { var arr = (Array) param.type_reference.data_type; for (int dim = 1; dim <= arr.rank; dim++) { ccall.add_argument (get_array_length_cexpression (arg, dim)); } } - if (param.type_reference.data_type != arg.static_type.data_type) { + if (arg.static_type.data_type != null && param.type_reference.data_type != arg.static_type.data_type) { // FIXME: use C cast if debugging disabled var ccall = new CCodeFunctionCall (new CCodeIdentifier (param.type_reference.data_type.get_upper_case_cname (null))); ccall.add_argument (cexpr); -- 2.7.4