From 66f46f81829bb77497ebd35ddfe368f421874a00 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 1 Nov 2018 23:53:44 -0500 Subject: [PATCH] widl: Correctly handle conformant arrays in clear_output_vars(). Signed-off-by: Zebediah Figura Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- tools/widl/proxy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index c56ef48d2b7..12424d9eab4 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -110,7 +110,13 @@ static void clear_output_vars( const var_list_t *args ) if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_BASIC) continue; if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_ENUM) continue; } - print_proxy( "if (%s) MIDL_memset( %s, 0, sizeof( *%s ));\n", arg->name, arg->name, arg->name ); + print_proxy( "if (%s) MIDL_memset( %s, 0, ", arg->name, arg->name ); + if (is_array(arg->type) && type_array_has_conformance(arg->type)) + { + write_expr( proxy, type_array_get_conformance(arg->type), 1, 1, NULL, NULL, "" ); + fprintf( proxy, " * " ); + } + fprintf( proxy, "sizeof( *%s ));\n", arg->name ); } }