]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libgcj/18036 (Bad interaction between interpreter and Class.forName())
authorAndrew Haley <aph@redhat.com>
Mon, 18 Oct 2004 14:07:42 +0000 (14:07 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Mon, 18 Oct 2004 14:07:42 +0000 (14:07 +0000)
2004-10-18  Andrew Haley  <aph@redhat.com>

        PR java/18036:
        * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Reorganize
        and correct logic used to find interpreter.

From-SVN: r89221

libjava/ChangeLog
libjava/gnu/gcj/runtime/natStackTrace.cc

index 70a79e06e3b831c64e7dbedd7fd315cf1a3417a0..2844e16fecb0897f6b1b0b75afa961e60395e409 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-18  Andrew Haley  <aph@redhat.com>
+
+       PR java/18036:
+       * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Reorganize
+       and correct logic used to find interpreter.
+       
 2004-10-18  Jeroen Frijters  <jeroen@frijters.net>
 
        * java/util/logging/LogManager.java
index fbe403a17efea64378cdb170f8bb7fafb286097e..d9f3355c04600c89255c1e93ad2e3a1fd10c320c 100644 (file)
@@ -65,7 +65,7 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
 #ifdef INTERPRETER
       extern void *const _Jv_StartOfInterpreter;
       extern void * _Jv_EndOfInterpreter;
-      
+
       java::lang::Thread *thread = java::lang::Thread::currentThread();
       _Jv_MethodChain *interp_frame
        = (thread ? reinterpret_cast<_Jv_MethodChain *> (thread->interp_frame)
@@ -92,20 +92,23 @@ gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
              // less than _Jv_EndOfInterpreter it might be in the
              // interpreter: we call _Unwind_FindEnclosingFunction to
              // find out.
-             if ((_Jv_EndOfInterpreter == NULL || pc < _Jv_EndOfInterpreter)
-                 && (_Unwind_FindEnclosingFunction (pc) 
-                     == _Jv_StartOfInterpreter))
-               {
-                 frame[n].interp = (void *) interp_frame->self;
-                 interp_frame = interp_frame->next;
-               }
-             else
+             if (pc >= _Jv_StartOfInterpreter
+                 && (pc < _Jv_EndOfInterpreter
+                     || _Jv_EndOfInterpreter == NULL))
                {
-                 // We've found an address that we know is not within
-                 // the interpreter.  We use that to refine our upper
-                 // bound on where the interpreter ends.
-                 if (_Jv_EndOfInterpreter == NULL || pc < _Jv_EndOfInterpreter)
-                   _Jv_EndOfInterpreter = pc;
+                 if (_Unwind_FindEnclosingFunction (pc) 
+                     == _Jv_StartOfInterpreter)
+                   {
+                     frame[n].interp = (void *) interp_frame->self;
+                     interp_frame = interp_frame->next;
+                   }
+                 else
+                   {
+                     // We've found an address that we know is not within
+                     // the interpreter.  We use that to refine our upper
+                     // bound on where the interpreter ends.
+                     _Jv_EndOfInterpreter = pc;
+                   }
                }
            }
 #endif // INTERPRETER
This page took 0.067305 seconds and 5 git commands to generate.