This is the mail archive of the 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.


2004-01-05  Andrew Haley  <>

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

RCS file: /cvs/gcc/gcc/libjava/java/lang/,v
retrieving revision 1.62
diff -p -2 -c -r1.62
***	13 Oct 2003 22:08:51 -0000	1.62
---	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]