diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-02 19:00:36 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-02 19:00:36 +0000 |
commit | a3162708dff65adaab2aa54e962f8b8c4b9aae7f (patch) | |
tree | f2f6341c5bb20b34a8982d73ef0b2920318f1be9 /gdb | |
parent | 84de6048cc4c90cb3fb9905bb2472956feb18c28 (diff) | |
download | gdb-a3162708dff65adaab2aa54e962f8b8c4b9aae7f.zip gdb-a3162708dff65adaab2aa54e962f8b8c4b9aae7f.tar.gz gdb-a3162708dff65adaab2aa54e962f8b8c4b9aae7f.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/valops.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 78a8694..e267bff 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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, diff --git a/gdb/valops.c b/gdb/valops.c index 86c3112..146f1a6 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -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: |