aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-07-31 08:56:09 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-07-31 08:56:09 +0000
commit20dde49d1f94e2a4e2b85ef3c769e5a0fd549b7a (patch)
tree215ce6e1f9ac1c01540385407fd0b161c86eb523 /gcc/cp
parentb7ad2f8bacf1036f5b01bebb45088567da987b4d (diff)
downloadgcc-20dde49d1f94e2a4e2b85ef3c769e5a0fd549b7a.zip
gcc-20dde49d1f94e2a4e2b85ef3c769e5a0fd549b7a.tar.gz
gcc-20dde49d1f94e2a4e2b85ef3c769e5a0fd549b7a.tar.bz2
re PR c++/3631 (another linking problem with virtual derivation)
cp: PR c++/3631 * class.c (update_vtable_entry_for_fn): The fixed adjustment of a virtual thunk should be from declaring base. testsuite: * g++.dg/abi/vthunk1.C: New test. From-SVN: r44509
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/class.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b1f52f3..ed40395 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/3631
+ * class.c (update_vtable_entry_for_fn): The fixed adjustment
+ of a virtual thunk should be from declaring base.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
* class.c (dfs_ctor_vtable_bases_queue_p): Always walk into
the shared virtual base, so preserving inheritance graph order.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f4aae8e..42c03713 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2563,10 +2563,10 @@ update_vtable_entry_for_fn (t, binfo, fn, virtuals)
(or one of its primary bases, which are at the same offset). */
if (virtual_base)
- /* The `this' pointer needs to be adjusted to the nearest virtual
- base. */
+ /* The `this' pointer needs to be adjusted from the declaration to
+ the nearest virtual base. */
delta = size_diffop (BINFO_OFFSET (virtual_base),
- BINFO_OFFSET (binfo));
+ BINFO_OFFSET (first_defn));
else
{
/* The `this' pointer needs to be adjusted from pointing to
@@ -2580,7 +2580,7 @@ update_vtable_entry_for_fn (t, binfo, fn, virtuals)
/* We'll need a thunk. But if we have a (perhaps formerly)
primary virtual base, we have a vcall slot for this function,
so we can use it rather than create a non-virtual thunk. */
-
+
b = get_primary_binfo (first_defn);
for (; b; b = get_primary_binfo (b))
{