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
commit7e604dd8c0ebf54ab545f229c2c2c1a786e9e51d (patch)
tree1ead66d22d98dd779a5fb5f0958851d9499b3d16 /gdb/valarith.c
parent242daac7f60f7e6609ec79dcebc57b8cf8d3cc72 (diff)
downloadgdb-7e604dd8c0ebf54ab545f229c2c2c1a786e9e51d.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))));
}