This is the mail archive of the java@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]

Re: dereferencing type-punned pointer will break strict-aliasing rules


Tom Tromey writes:
 > >>>>> "Jack" == Jack Howarth <howarth@bromo.msbb.uc.edu> writes:
 > 
 > Jack> Has anyone noticed that we are breaking the strict-aliasing ruls in
 > Jack> natVMVirtualMachine.cc?
 > 
 > Jack> Does this merit a bug report or how else should it be handled?
 > 
 > Please file a bug report.
 > Or fix it if you prefer :-)

This evil is all over the place:

  JNIEnv *env;
  vm->GetEnv((void **)&env, JNI_VERSION_1_1);

[ FWIW, The JNI version of GetEnv looks like this:

Prototype  jint GetEnv(JavaVM *vm, void **penv, jint interface_id);

Description  If the current thread is not attached to the given virtual
machine instance, sets *penv to NULL, and returns JNI_EDETACHED. If
the specified interface is not supported, sets *penv to NULL, and
returns JNI_EVERSION. Otherwise, sets *env to the appropriate
interface, and returns JNI_OK. ]

We probably ned to go over the whole gcj tree and fix them all.  :-(

Andrew.


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