Commit 50106e8f by Andrew Haley

re PR libgcj/14296 (3.4 regression: Method.Invoke)

2004-02-25  Andrew Haley  <aph@redhat.com>

	PR java/14296:
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Make sure
	we have a valid method index.

From-SVN: r78504
parent d0c8fd2a
...@@ -466,7 +466,16 @@ _Jv_CallAnyMethodA (jobject obj, ...@@ -466,7 +466,16 @@ _Jv_CallAnyMethodA (jobject obj,
void *ncode; void *ncode;
if (is_virtual_call && ! Modifier::isFinal (meth->accflags)) // FIXME: If a vtable index is -1 at this point it is invalid, so we
// have to use the ncode.
//
// This can happen because methods in final classes don't have
// vtable entries, but _Jv_isVirtualMethod() doesn't know that. We
// could solve this problem by allocating a vtable index for methods
// in final classes.
if (is_virtual_call
&& ! Modifier::isFinal (meth->accflags)
&& (_Jv_ushort)-1 != meth->index)
{ {
_Jv_VTable *vtable = *(_Jv_VTable **) obj; _Jv_VTable *vtable = *(_Jv_VTable **) obj;
ncode = vtable->get_method (meth->index); ncode = vtable->get_method (meth->index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment