This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
jc1 patch: class_dtable_decl should be external
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Subject: jc1 patch: class_dtable_decl should be external
- From: Per Bothner <per at bothner dot com>
- Date: 15 Mar 2001 20:56:54 -0800
After getting the gcc w/java to bootstrap, my test application would
immediately crash. Turned out the vtable for Class was for all zeros.
Well, actually, it turned out that there were *many* vtables for Class,
one for each compilation, because DECL_EXTERNAL wasn't set; all except
the real one were bss-local. Ooops.
It is possible I broke this March 5, and it wasn't caught earlier
because the compiler has been broken since then :-(
I checked this in.
2001-03-13 Per Bothner <per@bothner.com>
* class.c (make_class_data): The class_dtable_decl (i.e. the
vtable for Class) should be external, except when compiling Class.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.91
diff -u -p -r1.91 class.c
--- class.c 2001/03/15 02:51:03 1.91
+++ class.c 2001/03/16 04:33:35
@@ -1359,6 +1359,8 @@ make_class_data (type)
TREE_STATIC (class_dtable_decl) = 1;
DECL_ARTIFICIAL (class_dtable_decl) = 1;
DECL_IGNORED_P (class_dtable_decl) = 1;
+ if (is_compiled_class (class_type_node) != 2)
+ DECL_EXTERNAL (class_dtable_decl) = 1;
rest_of_decl_compilation (class_dtable_decl, (char*) 0, 1, 0);
}
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/