summaryrefslogtreecommitdiff
path: root/gdb/valarith.c
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/valarith.c
parentf45a6ffc193d366794075c481b79f20834f7ff11 (diff)
downloadbinutils-gdb-dbbd9c57ff004955375f214b66a29cd0abf101fd.tar.gz
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/valarith.c')
-rw-r--r--gdb/valarith.c2
1 files changed, 1 insertions, 1 deletions
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))));
}