class.c (build_vtable_entry_ref): Correct usage of get_vtbl_decl_for_binfo.
authorMark Mitchell <mark@codesourcery.com>
Fri, 26 May 2000 17:47:25 +0000 (17:47 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 26 May 2000 17:47:25 +0000 (17:47 +0000)
* class.c (build_vtable_entry_ref): Correct usage of
get_vtbl_decl_for_binfo.

From-SVN: r34195

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/g++.old-deja/g++.other/crash18.C [new file with mode: 0644]

index 1bccc36..656ce2a 100644 (file)
@@ -1,5 +1,8 @@
 2000-05-26  Mark Mitchell  <mark@codesourcery.com>
 
+       * class.c (build_vtable_entry_ref): Correct usage of
+       get_vtbl_decl_for_binfo.
+
        * decl2.c (grokclassfn): Set DECL_LANGUAGE here.
        * method.c (implicitly_declare_fn): Not here.
 
index d865fba..2fbdeb4 100644 (file)
@@ -485,7 +485,9 @@ build_vtable_entry_ref (basetype, vtbl, idx)
   static char asm_stmt[] = ".vtable_entry %c0, %c1";
   tree s, i, i2;
 
-  s = build_unary_op (ADDR_EXPR, get_vtbl_decl_for_binfo (basetype), 0);
+  s = build_unary_op (ADDR_EXPR, 
+                     get_vtbl_decl_for_binfo (TYPE_BINFO (basetype)), 
+                     0);
   s = build_tree_list (build_string (1, "s"), s);
 
   i = build_array_ref (vtbl, idx);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash18.C b/gcc/testsuite/g++.old-deja/g++.other/crash18.C
new file mode 100644 (file)
index 0000000..789e316
--- /dev/null
@@ -0,0 +1,14 @@
+// Build don't link:
+// Special g++ Options: -fvtable-gc
+// Origin: Mark Mitchell <mitchell@codesourcery.com>
+
+struct S {
+  virtual void f ();
+};
+
+S* s;
+
+void g ()
+{
+  s->f ();
+}