commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kohs...@apache.org
Subject svn commit: r359665 - /jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Date Wed, 28 Dec 2005 23:46:05 GMT
Author: kohsuke
Date: Wed Dec 28 15:46:03 2005
New Revision: 359665

URL: http://svn.apache.org/viewcvs?rev=359665&view=rev
Log:
fixed a bug in instrumenting doubly-nested JSR/RET subroutines.

Modified:
    jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java

Modified: jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java?rev=359665&r1=359664&r2=359665&view=diff
==============================================================================
--- jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
(original)
+++ jakarta/commons/sandbox/javaflow/trunk/src/java/org/apache/commons/javaflow/bytecode/transformation/bcel/BcelClassTransformer.java
Wed Dec 28 15:46:03 2005
@@ -47,7 +47,6 @@
 import org.apache.bcel.generic.PUSH;
 import org.apache.bcel.generic.RET;
 import org.apache.bcel.generic.ReferenceType;
-import org.apache.bcel.generic.ReturnaddressType;
 import org.apache.bcel.generic.TABLESWITCH;
 import org.apache.bcel.generic.TargetLostException;
 import org.apache.bcel.generic.Type;
@@ -307,13 +306,11 @@
             final ExecutionPath newchain = oldchain.append(u);
 
             if ((u.getInstruction().getInstruction()) instanceof RET) {
-                // We can only follow _one_ successor, the one after the
-                // JSR that was recently executed.
-                final RET ret = (RET) u.getInstruction().getInstruction();
-                final ReturnaddressType t = (ReturnaddressType) u.getOutFrame(oldchain).getLocals().get(ret.getIndex());
-                final InstructionContext theSuccessor = cfg.contextOf(t.getTarget());
+                // where did we come from? this JSR
+                InstructionHandle jsr = oldchain.lastExecutionJSR().getInstruction();
+                // so the next instruction to execute will be this
+                final InstructionContext theSuccessor = cfg.contextOf(jsr.getNext());
 
-                //if (theSuccessor.execute(u.getOutFrame(oldchain), newchain, icv, ev)) {
                 if (theSuccessor.execute(u.getOutFrame(oldchain), newchain, ev)) {
                     ics.add(theSuccessor);
                     ecs.add(newchain);



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message