202001-10-15 Jim Ingham <jingham@inghji.apple.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 16 Oct 2001 01:19:09 +0000 (01:19 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 16 Oct 2001 01:19:09 +0000 (01:19 +0000)
* valarith.c (value_sub): Don't pass a raw type to
value_from_pointer, it has to go through check_typedef first.

gdb/ChangeLog
gdb/valarith.c

index 3c9dfd00cdf9a7dbdda56f794e30a81d80fbaf47..9eff17cf17f9239afbf137dec48a666d74524aa2 100644 (file)
@@ -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
index e0598d08d7a47d4a4bffb02e5c14fef3a7579bf2..a9ba5c76e02e5371e7f3a85acf12ff3481bc608f 100644 (file)
@@ -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))));
        }