# The following patch fixes a bug in gcc 3.4. Jni code could not
# invoke methods anymore, so the PHP/Java Bridge crashes when
# iterating through the global hash. To apply the patch cd to the
# directory that contains the PHP 5 source, for example cd gcc-3.4.3
# and then type: patch -p1 <../gcc3.4-broken-jni-method-lookup.patch
--- gcc-3.4.3/libjava/java/lang/reflect/natMethod.cc~ 2005-01-18 20:00:36.000000000 +0100
+++ gcc-3.4.3/libjava/java/lang/reflect/natMethod.cc 2005-01-18 20:00:36.000000000 +0100
@@ -478,7 +478,20 @@
&& (_Jv_ushort)-1 != meth->index)
{
_Jv_VTable *vtable = *(_Jv_VTable **) obj;
- ncode = vtable->get_method (meth->index);
+ if(is_jni_call) {
+ _Jv_Method *concrete_meth
+ = _Jv_LookupDeclaredMethod (vtable->clas,
+ meth->name,
+ meth->signature);
+ if (concrete_meth == NULL
+ || concrete_meth->ncode == NULL
+ || Modifier::isAbstract(concrete_meth->accflags))
+ throw new java::lang::Error
+ (_Jv_GetMethodString (vtable->clas, meth->name));
+ ncode = concrete_meth->ncode;
+ } else {
+ ncode = vtable->get_method (meth->index);
+ }
}
else
{