diff options
author | Chris Moller <cmoller@cygnus> | 2009-12-10 20:57:10 +0000 |
---|---|---|
committer | Chris Moller <cmoller@cygnus> | 2009-12-10 20:57:10 +0000 |
commit | 191ca0a151fe8d5d19097b476b4050697b0e70ba (patch) | |
tree | 1fed80abe67c35ae502ef970e6d452789ab17a40 /gdb/valops.c | |
parent | a0351a698b33aea0c0cec14ae44070a45bac6329 (diff) | |
download | gdb-191ca0a151fe8d5d19097b476b4050697b0e70ba.zip gdb-191ca0a151fe8d5d19097b476b4050697b0e70ba.tar.gz gdb-191ca0a151fe8d5d19097b476b4050697b0e70ba.tar.bz2 |
Fix for PR 9399 gdb can't call or print a const function that uses virtual inheritance
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 99c99f1..cf93787 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -232,6 +232,11 @@ value_cast_structs (struct type *type, struct value *v2) || TYPE_CODE (t2) == TYPE_CODE_UNION) && !!"Precondition is that value is of STRUCT or UNION kind"); + if (TYPE_NAME (t1) != NULL + && TYPE_NAME (t2) != NULL + && !strcmp (TYPE_NAME (t1), TYPE_NAME (t2))) + return NULL; + /* Upcasting: look in the type of the source to see if it contains the type of the target as a superclass. If so, we'll need to offset the pointer rather than just change its type. */ |