This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[ecj] Patch: FYI: link main's class
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 19 Jun 2006 16:17:56 -0600
- Subject: [ecj] Patch: FYI: link main's class
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcj-eclipse branch.
Sometimes we can end up with a main class which is not fully linked.
This patch fixes the problem by linking the main class.
This fixes a test suite failure.
Tom
2006-06-19 Tom Tromey <tromey@redhat.com>
* gnu/java/lang/natMainThread.cc (call_main): Link main class.
Index: gnu/java/lang/natMainThread.cc
===================================================================
--- gnu/java/lang/natMainThread.cc (revision 114362)
+++ gnu/java/lang/natMainThread.cc (working copy)
@@ -29,6 +29,10 @@
Utf8Const* main_signature = _Jv_makeUtf8Const ("([Ljava.lang.String;)V", 22);
Utf8Const* main_name = _Jv_makeUtf8Const ("main", 4);
+ // This is one of the few places where we might have access to an
+ // unlinked class.
+ _Jv_Linker::wait_for_state (klass, JV_STATE_LOADING);
+
_Jv_Method *meth = _Jv_LookupDeclaredMethod (klass, main_name,
main_signature);