re PR libgcj/11779 (Field reflection incorrectly throws IllegalAccessException)
Fix for PR libgcj/11779: * java/lang/reflect/natField.cc (getAddr): Skip frames in Field class. From-SVN: r70185
This commit is contained in:
parent
0d4d227907
commit
0196f4e0a5
2 changed files with 10 additions and 5 deletions
|
@ -59,13 +59,14 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
|
|||
// calls. However, we never implemented that, so we have to find
|
||||
// the caller by hand instead.
|
||||
gnu::gcj::runtime::StackTrace *t
|
||||
= new gnu::gcj::runtime::StackTrace(4);
|
||||
= new gnu::gcj::runtime::StackTrace(7);
|
||||
try
|
||||
{
|
||||
for (int i = 1; !caller; i++)
|
||||
{
|
||||
caller = t->classAt (i);
|
||||
}
|
||||
// We want to skip all the frames on the stack from this class.
|
||||
for (int i = 1;
|
||||
!caller || caller == &java::lang::reflect::Field::class$;
|
||||
i++)
|
||||
caller = t->classAt (i);
|
||||
}
|
||||
catch (::java::lang::ArrayIndexOutOfBoundsException *e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue