From dbbd9c57ff004955375f214b66a29cd0abf101fd Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 16 Oct 2001 01:19:09 +0000 Subject: 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. --- gdb/ChangeLog | 5 +++++ gdb/valarith.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3c9dfd0..9eff17c 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 e0598d0..a9ba5c7 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)))); } -- cgit v1.1