From: Elena Zannoni Date: Thu, 2 May 2002 19:00:36 +0000 (+0000) Subject: 2002-05-02 Elena Zannoni X-Git-Tag: binutils-2_13-branchpoint~1117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3162708dff65adaab2aa54e962f8b8c4b9aae7f;p=thirdparty%2Fbinutils-gdb.git 2002-05-02 Elena Zannoni * valops.c (value_arg_coerce): Don't coerce arrays to pointers if we are dealing with vectors. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 78a86946f8b..e267bff087c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-05-02 Elena Zannoni + + * valops.c (value_arg_coerce): Don't coerce arrays to pointers if + we are dealing with vectors. + 2002-05-02 Pierre Muller * config/m68k/tm-nbsd.h: Obvious fix, diff --git a/gdb/valops.c b/gdb/valops.c index 86c31122b3b..146f1a6d051 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: