aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-10-16 01:19:09 +0000
committerAndrew Cagney <cagney@redhat.com>2001-10-16 01:19:09 +0000
commitdbbd9c57ff004955375f214b66a29cd0abf101fd (patch)
tree93142645a95846ef93b5da20d702824ec5871c10 /gdb
parentf45a6ffc193d366794075c481b79f20834f7ff11 (diff)
downloadgdb-dbbd9c57ff004955375f214b66a29cd0abf101fd.zip
gdb-dbbd9c57ff004955375f214b66a29cd0abf101fd.tar.gz
gdb-dbbd9c57ff004955375f214b66a29cd0abf101fd.tar.bz2
202001-10-15 Jim Ingham <jingham@inghji.apple.com>
* valarith.c (value_sub): Don't pass a raw type to value_from_pointer, it has to go through check_typedef first.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/valarith.c2
2 files changed, 6 insertions, 1 deletions
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 <jingham@inghji.apple.com>
+
+ * 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 <ac131313@redhat.com>
* 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))));
}