Commit 0623a8c0 by Tom Tromey Committed by Tom Tromey

* java/lang/natClass.cc (_Jv_getInterfaceMethod): Skip <clinit>.

From-SVN: r113229
parent 9fff6432
2006-04-24 Tom Tromey <tromey@redhat.com>
* java/lang/natClass.cc (_Jv_getInterfaceMethod): Skip <clinit>.
2006-04-21 Andrew Haley <aph@redhat.com> 2006-04-21 Andrew Haley <aph@redhat.com>
* include/execution.h (struct _Jv_CompiledEngine): Define for * include/execution.h (struct _Jv_CompiledEngine): Define for
......
...@@ -1182,9 +1182,14 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index, ...@@ -1182,9 +1182,14 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index,
if (!klass->isInterface ()) if (!klass->isInterface ())
return false; return false;
int i = klass->method_count; int max = klass->method_count;
while (--i >= 0) int offset = 0;
for (int i = 0; i < max; ++i)
{ {
// Skip <clinit> here, as it will not be in the IDT.
if (klass->methods[i].name->first() == '<')
continue;
if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name) if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name)
&& _Jv_equalUtf8Consts (klass->methods[i].signature, utf_sig)) && _Jv_equalUtf8Consts (klass->methods[i].signature, utf_sig))
{ {
...@@ -1197,9 +1202,11 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index, ...@@ -1197,9 +1202,11 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index,
found_class = klass; found_class = klass;
// Interface method indexes count from 1. // Interface method indexes count from 1.
index = i+1; index = offset + 1;
return true; return true;
} }
++offset;
} }
} }
...@@ -1211,8 +1218,8 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index, ...@@ -1211,8 +1218,8 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index,
{ {
using namespace java::lang::reflect; using namespace java::lang::reflect;
bool found = _Jv_getInterfaceMethod (search_class->interfaces[i], bool found = _Jv_getInterfaceMethod (search_class->interfaces[i],
found_class, index, found_class, index,
utf_name, utf_sig); utf_name, utf_sig);
if (found) if (found)
return true; return true;
} }
......
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