Zebediah Figura : widl: Correctly handle conformant arrays in clear_output_vars().

Alexandre Julliard julliard at winehq.org
Fri Nov 2 18:03:19 CDT 2018


Module: wine
Branch: master
Commit: 66f46f81829bb77497ebd35ddfe368f421874a00
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=66f46f81829bb77497ebd35ddfe368f421874a00

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Nov  1 23:53:44 2018 -0500

widl: Correctly handle conformant arrays in clear_output_vars().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 c56ef48..12424d9 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 );
   }
 }
 




More information about the wine-cvs mailing list