This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ecj] Patch: FYI: link main's class


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);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]