diff options
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/value.c b/gdb/value.c index 1fa376d..695aa33 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1728,12 +1728,21 @@ coerce_ref (struct value *arg) struct value * coerce_array (struct value *arg) { + struct type *type; + arg = coerce_ref (arg); - if (current_language->c_style_arrays - && TYPE_CODE (value_type (arg)) == TYPE_CODE_ARRAY) - arg = value_coerce_array (arg); - if (TYPE_CODE (value_type (arg)) == TYPE_CODE_FUNC) - arg = value_coerce_function (arg); + type = check_typedef (value_type (arg)); + + switch (TYPE_CODE (type)) + { + case TYPE_CODE_ARRAY: + if (current_language->c_style_arrays) + arg = value_coerce_array (arg); + break; + case TYPE_CODE_FUNC: + arg = value_coerce_function (arg); + break; + } return arg; } |