aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c6
1 files changed, 5 insertions, 1 deletions
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: