Skip to content

Commit

Permalink
temporary update
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzun66 committed Nov 5, 2024
1 parent 56a299d commit 93d368c
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
Expand All @@ -20,7 +19,6 @@
import sootup.core.jimple.common.ref.IdentityRef;
import sootup.core.jimple.common.stmt.*;
import sootup.core.model.Body;
import sootup.core.model.Method;
import sootup.core.model.SourceType;
import sootup.core.signatures.MethodSignature;
import sootup.core.types.ClassType;
Expand All @@ -29,7 +27,6 @@
import sootup.interceptors.StaticSingleAssignmentFormer;
import sootup.java.bytecode.frontend.inputlocation.PathBasedAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaJimple;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
Expand Down Expand Up @@ -84,13 +81,15 @@ public class StaticSingleAssignmentFormerTest {
l3, JavaJimple.newAddExpr(l3, IntConstant.getInstance(2)), noStmtPositionInfo);
JGotoStmt gotoStmt1 = JavaJimple.newGotoStmt(noStmtPositionInfo);
JGotoStmt gotoStmt2 = JavaJimple.newGotoStmt(noStmtPositionInfo);
JGotoStmt gotoStmt3 = JavaJimple.newGotoStmt(noStmtPositionInfo);

FallsThroughStmt handlerStmt =
JavaJimple.newIdentityStmt(stack4, caughtExceptionRef, noStmtPositionInfo);
JAssignStmt l2eq0 =
JavaJimple.newAssignStmt(l2, IntConstant.getInstance(0), noStmtPositionInfo);
JAssignStmt l2eq2 =
JavaJimple.newAssignStmt(l2, IntConstant.getInstance(2), noStmtPositionInfo);
JGotoStmt gotoStmt = JavaJimple.newGotoStmt(noStmtPositionInfo);


@Test
public void testSSA() {
StaticSingleAssignmentFormer ssa = new StaticSingleAssignmentFormer();
Expand Down Expand Up @@ -357,6 +356,7 @@ private Body.BodyBuilder createTrapBody() {

// block4
graph.putEdge(ifStmt2, JIfStmt.TRUE_BRANCH_IDX, assignl1tol2);
graph.addExceptionalEdge(assignl1tol2, exceptionType, handlerStmt);
graph.putEdge(assignl1tol2, assignl3plus1tol3);
graph.putEdge(assignl3plus1tol3, gotoStmt1);

Expand All @@ -371,11 +371,12 @@ private Body.BodyBuilder createTrapBody() {
graph.putEdge(gotoStmt, JGotoStmt.BRANCH_IDX, ifStmt);

// add exception
graph.addNode(assignl1tol2, Collections.singletonMap(exceptionType, handlerStmt));

graph.putEdge(handlerStmt, l2eq0);
graph.putEdge(l2eq0, gotoStmt);
graph.putEdge(gotoStmt, JGotoStmt.BRANCH_IDX, assignl3plus1tol3);

graph.putEdge(handlerStmt, l2eq2);
graph.putEdge(l2eq2, gotoStmt3);
graph.putEdge(gotoStmt3, JGotoStmt.BRANCH_IDX, assignl3plus1tol3);
graph.buildTraps();

Body.BodyBuilder builder = Body.builder(graph);
builder.setMethodSignature(methodSignature);
Expand Down

0 comments on commit 93d368c

Please sign in to comment.