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]

Eww: Modifier.INTERPRETED overload

If you look in java/lang/reflect/ you'll see:

   * Flag indicating a synthetic member.
  static final int SYNTHETIC = 0x1000;


   * GCJ-LOCAL: This access flag is set on interpreted classes.
  static final int INTERPRETED = 0x1000;

This should, perhaps, ring an alarm bell.  Way back when this code was
written, classes weren't marked synthetic, but they are now!
So, any compiled class that is marked as SYNTHETIC is treated as
INTERPRETED by libgcj.  Bad Things Happen.

We really need to find another way of marking classes as interpreted,
but clearing the INTERPRETED flag when loading the class prevents a


2007-05-30  Andrew Haley  <>

	* java/lang/ (_Jv_NewClassFromInitializer): Clear
	INTERPRETED access modifier.

---	(revision 124185)
+++	(working copy)
@@ -281,7 +281,16 @@
   memcpy (dst, src, len);
   new_class->engine = &_Jv_soleIndirectCompiledEngine;
+  /* FIXME:  Way back before the dawn of time, we overloaded the
+     SYNTHETIC class access modifier to mean INTERPRETED.  This was a
+     Bad Thing, but it didn't matter then because classes were never
+     marked synthetic.  However, it is possible to redeem the
+     situation: _Jv_NewClassFromInitializer is only called from
+     compiled classes, so we clear the INTERPRETED flag.  This is a
+     kludge!  */
+  new_class->accflags &= ~java::lang::reflect::Modifier::INTERPRETED;
   (*_Jv_RegisterClassHook) (new_class);
   return new_class;

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