dereferencing type-punned pointer will break strict-aliasing rules
Andrew Haley
aph@redhat.com
Thu Oct 12 09:53:00 GMT 2006
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.
More information about the Java
mailing list