[PATCH 1/2] widl: Correctly handle conformant arrays in clear_output_vars().
Zebediah Figura
z.figura12 at gmail.com
Thu Nov 1 23:53:44 CDT 2018
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
This fixes the test failure with the following patch reported here:
https://www.winehq.org/pipermail/wine-devel/2018-November/134397.html
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 c56ef48d2b..12424d9eab 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 );
}
}
--
2.19.1
More information about the wine-devel
mailing list