From: Andrew Cagney Date: Tue, 16 Oct 2001 01:19:09 +0000 (+0000) Subject: 202001-10-15 Jim Ingham X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbbd9c57ff004955375f214b66a29cd0abf101fd;p=binutils-gdb.git 202001-10-15 Jim Ingham * valarith.c (value_sub): Don't pass a raw type to value_from_pointer, it has to go through check_typedef first. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3c9dfd00cdf..9eff17cf17f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +202001-10-15 Jim Ingham + + * valarith.c (value_sub): Don't pass a raw type to + value_from_pointer, it has to go through check_typedef first. + 2001-10-15 Andrew Cagney * gdbarch.sh (fallbackdefault): Set to one when predefault is diff --git a/gdb/valarith.c b/gdb/valarith.c index e0598d08d7a..a9ba5c76e02 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -104,7 +104,7 @@ value_sub (value_ptr arg1, value_ptr arg2) { /* pointer - integer. */ LONGEST sz = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1))); - return value_from_pointer (VALUE_TYPE (arg1), + return value_from_pointer (type1, (value_as_pointer (arg1) - (sz * value_as_long (arg2)))); }