This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 11779 fix
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: 05 Aug 2003 13:59:08 -0600
- Subject: Patch: FYI: PR 11779 fix
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk.
This fixes PR 11779. The lookup code in Field is run several layers
deep in the Field class; we have to ignore other frames from Field.
I've put the test case from the PR into Mauve.
Tom
Index: libjava/ChangeLog
from Tom Tromey <tromey@redhat.com>
Fix for PR libgcj/11779:
* java/lang/reflect/natField.cc (getAddr): Skip frames in Field
class.
Index: libjava/java/lang/reflect/natField.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/reflect/natField.cc,v
retrieving revision 1.13
diff -u -r1.13 natField.cc
--- libjava/java/lang/reflect/natField.cc 21 Jul 2003 01:54:06 -0000 1.13
+++ libjava/java/lang/reflect/natField.cc 5 Aug 2003 19:59:08 -0000
@@ -59,13 +59,14 @@
// 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)
{