This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: New stack trace code
Andrew Haley wrote:
A few more bug fixes.
1. source_file_name wasn't being marked for GC.
2. VMSecurityManager.getClassContext() assumed it was always being
called by SecurityManager. This isn't true: it is also called by
ClassLoader and Package. This causes the search to run off the
end of the stack.
Ugh - thanks for fixing that.
One concern here is that changing the interface to VMSecurityManager
breaks compatibility with GNU Classpath - and some of these classes are
supposed to be merged. Using VMSecurityManager.getClassContext() here
does suck, and I know the classpath guys have been talking about doing a
better (Java) interface to get stack info. I'll look at this next week
and propose something (VMSecurityManager.getCallingClass(), perhaps?)
--- 465,479 ----
FillInFrameInfo (frame);
! if (seen_checkClass)
{
! if (frame->klass)
! {
! jframe_count++;
! if (start_pos == -1)
! start_pos = i;
! }
}
! else
! seen_checkClass = frame->klass == checkClass;
}
result = (JArray<jclass> *) _Jv_NewObjectArray (jframe_count, &Class::class$, NULL);
Yes, this is much nicer, thanks! Maybe CNI's elements() needs to do
bounds checking :)
Please go ahead and check this patch in if you didn't already.
Bryce