FYI: AccessController stack bugfix

Gary Benson gbenson@redhat.com
Wed Aug 9 15:02:00 GMT 2006


Hi all,

This commit fixes a bug in my previous AccessController commit whereby
the trace returned by _Jv_StackTrace::GetClassMethodStack() could be
one frame short if an AccessController.doPrivileged() was found.

Cheers,
Gary
-------------- next part --------------
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 116033)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2006-08-09  Gary Benson  <gbenson@redhat.com>
+
+	* stacktrace.cc (accesscontrol_trace_fn): Skip non-Java frames.
+
 2006-08-09  Gary Benson  <gbenson@redhat.com>
 
 	* java/lang/System.java (setSecurityManager): Javadoc fix.
Index: stacktrace.cc
===================================================================
--- stacktrace.cc	(revision 116033)
+++ stacktrace.cc	(working copy)
@@ -542,12 +542,14 @@
   _Jv_StackFrame *frame = &state->frames[state->pos];
   FillInFrameInfo (frame);
 
+  if (!(frame->klass && frame->meth))
+    return _URC_NO_REASON;
+
   bool *stopping = (bool *) state->trace_data;
   if (*stopping)
     return _URC_NORMAL_STOP;
   
   if (frame->klass == &::java::security::AccessController::class$
-      && frame->meth
       && strcmp (frame->meth->name->chars(), "doPrivileged") == 0)
     *stopping = true;
 


More information about the Java-patches mailing list