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]

Resolve a Utf8Const before looking at its class


This one came up with indirect dispatch, but it could come up in other
circumstances.  We can't look at the class of a field before resolving
it.  This patch nearly qualifies as "obvious".

An more reliable approach, but perhaps less efficient, would be to
make _Jv_Field::getClass() call _Jv_ResolveField.

Andrew.


2004-01-05  Andrew Haley  <aph@redhat.com>

	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Resolve
	a Utf8Const before looking at its class.

Index: natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.62
diff -p -2 -c -r1.62 natClassLoader.cc
*** natClassLoader.cc	13 Oct 2003 22:08:51 -0000	1.62
--- natClassLoader.cc	5 Jan 2004 14:58:54 -0000
*************** _Jv_PrepareCompiledClass (jclass klass)
*** 263,266 ****
--- 263,267 ----
  	  // If we have a static String field with a non-null initial
  	  // value, we know it points to a Utf8Const.
+ 	  _Jv_ResolveField(f, klass->loader);
  	  if (f->getClass () == &java::lang::String::class$
  	      && java::lang::reflect::Modifier::isStatic (mod))


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