diff options
author | Tom Tromey <tromey@redhat.com> | 2011-11-09 19:50:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-11-09 19:50:15 +0000 |
commit | a7860e76c92d8aea95640ce1a75822efeaed4f32 (patch) | |
tree | aa25ec6272ee282de2055d1a395c6516a354a7db /gdb/valops.c | |
parent | b121d7d4e41eebde43ebd368704897b7b1d96d6e (diff) | |
download | gdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.zip gdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.tar.gz gdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.tar.bz2 |
gdb
PR c++/13342:
* valops.c (value_full_object): Return early if real type is
smaller than the enclosing type.
gdb/testsuite
* gdb.cp/destrprint.exp: New file.
* gdb.cp/destrprint.cc: New file.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index cb39677..29d1fbd 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3581,6 +3581,13 @@ value_full_object (struct value *argp, if (!real_type || real_type == value_enclosing_type (argp)) return argp; + /* In a destructor we might see a real type that is a superclass of + the object's type. In this case it is better to leave the object + as-is. */ + if (full + && TYPE_LENGTH (real_type) < TYPE_LENGTH (value_enclosing_type (argp))) + return argp; + /* If we have the full object, but for some reason the enclosing type is wrong, set it. */ /* pai: FIXME -- sounds iffy */ |