Robert Shearman : widl: Fix a SEGV when using arrays declared using a pointer and

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 1 06:59:12 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 0d4e1bc33679f4997f0d178ee88000914794f3bb
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=0d4e1bc33679f4997f0d178ee88000914794f3bb

Author: Robert Shearman <rob at codeweavers.com>
Date:   Wed Feb  1 12:29:23 2006 +0100

widl: Fix a SEGV when using arrays declared using a pointer and
attributes, instead of array indices (reported by Eric Kohl).

---

 tools/widl/typegen.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 8b6e081..546e693 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -639,7 +639,7 @@ static size_t write_array_tfs(FILE *file
 
     /* FIXME: need to analyse type for pointers */
 
-    if (NEXT_LINK(array)) /* multi-dimensional array */
+    if (array && NEXT_LINK(array)) /* multi-dimensional array */
     {
         error("write_array_tfs: Multi-dimensional arrays not implemented yet (param %s)\n", name);
         return 0;
@@ -1170,7 +1170,7 @@ void marshall_arguments(FILE *file, int 
             int has_length = length_is && (length_is->type != EXPR_VOID);
             int has_size = (size_is && (size_is->type != EXPR_VOID)) || !var->array->is_const;
 
-            if (NEXT_LINK(var->array)) /* multi-dimensional array */
+            if (var->array && NEXT_LINK(var->array)) /* multi-dimensional array */
                 array_type = "ComplexArray";
             else
             {
@@ -1364,7 +1364,7 @@ void unmarshall_arguments(FILE *file, in
             int has_length = length_is && (length_is->type != EXPR_VOID);
             int has_size = (size_is && (size_is->type != EXPR_VOID)) || !var->array->is_const;
 
-            if (NEXT_LINK(var->array)) /* multi-dimensional array */
+            if (var->array && NEXT_LINK(var->array)) /* multi-dimensional array */
                 array_type = "ComplexArray";
             else
             {




More information about the wine-cvs mailing list