summaryrefslogtreecommitdiffstats
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-07-12 18:00:48 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-07-12 18:00:48 +0000
commit1326dacef924696d3969b43f152b39443b728c43 (patch)
tree476167ad824aa73a2a78ea5a152dc0b6bb3d326f /gdb/c-valprint.c
parenteabbe766c0625a37de5b49f7e9e8e55ac87b5c1c (diff)
downloadppe42-binutils-1326dacef924696d3969b43f152b39443b728c43.tar.gz
ppe42-binutils-1326dacef924696d3969b43f152b39443b728c43.zip
* c-valprint.c (c_val_print): Fix thinko with unspecified length
arrays.
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r--gdb/c-valprint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index dca35f3dd1..f50432d40b 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -137,8 +137,8 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
break;
}
/* Array of unspecified length: treat like pointer to first elt. */
- valaddr = (char *) &address;
- /* FALL THROUGH */
+ addr = address;
+ goto print_unpacked_pointer;
case TYPE_CODE_PTR:
if (format && format != 's')
@@ -159,6 +159,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
else
{
addr = unpack_pointer (type, valaddr);
+ print_unpacked_pointer:
elttype = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
OpenPOWER on IntegriCloud