2002-05-02 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Thu, 2 May 2002 19:00:36 +0000 (19:00 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Thu, 2 May 2002 19:00:36 +0000 (19:00 +0000)
* valops.c (value_arg_coerce): Don't coerce arrays to pointers if
we are dealing with vectors.

gdb/ChangeLog
gdb/valops.c

index 78a86946f8b8413023a6aa0cf7bce211a1f8849f..e267bff087c468b7763ba15228d7558ff88a879a 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * valops.c (value_arg_coerce): Don't coerce arrays to pointers if
+       we are dealing with vectors.
+
 2002-05-02  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        * config/m68k/tm-nbsd.h: Obvious fix,
index 86c31122b3bd7880b20478863054afe27c0f76e2..146f1a6d05128d2e0f4a871d73433ef47bd36ec8 100644 (file)
@@ -1190,8 +1190,12 @@ value_arg_coerce (struct value *arg, struct type *param_type,
       type = lookup_pointer_type (type);
       break;
     case TYPE_CODE_ARRAY:
+      /* Arrays are coerced to pointers to their first element, unless
+         they are vectors, in which case we want to leave them alone,
+         because they are passed by value.  */
       if (current_language->c_style_arrays)
-       type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
+       if (!TYPE_VECTOR (type))
+         type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
       break;
     case TYPE_CODE_UNDEF:
     case TYPE_CODE_PTR: