Skip to content

Commit

Permalink
Fix wrong transformer order
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMil committed Oct 10, 2024
1 parent 9301f8b commit e730d90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/soot/dexpler/DexBody.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ public Body jimplify(Body b, SootMethod m) {

// Make sure that we don't have any overlapping uses due to returns
DexReturnInliner.v().transform(jBody);
convertFloatsAndDoubles(b, jimple);

new SharedInitializationLocalSplitter(DalvikThrowAnalysis.v()).transform(jBody);

Expand Down Expand Up @@ -784,8 +785,6 @@ public Body jimplify(Body b, SootMethod m) {
}
DexFillArrayDataTransformer.v().transform(jBody);

convertFloatsAndDoubles(b, jimple);

TypeAssigner.v().transform(jBody);

// Shortcut: Reduce array initializations
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/soot/dexpler/DexNullThrowTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
import soot.SootMethodRef;
import soot.Type;
import soot.Unit;
import soot.Value;
import soot.jimple.AssignStmt;
import soot.jimple.IntConstant;
import soot.jimple.Jimple;
import soot.jimple.LengthExpr;
import soot.jimple.LongConstant;
import soot.jimple.NullConstant;
import soot.jimple.Stmt;
Expand Down Expand Up @@ -80,6 +83,16 @@ protected void internalTransform(Body b, String phaseName, Map<String, String> o
createThrowStmt(b, throwStmt, lc);
}
}
if (u instanceof AssignStmt) {
AssignStmt throwStmt = (AssignStmt) u;
Value rop = throwStmt.getRightOp();
if (rop instanceof LengthExpr) {
LengthExpr l = (LengthExpr) rop;
if (l.getOp() == nc || l.getOp().equals(ic) || l.getOp().equals(llc) || l.getOp().equals(bc)) {
createThrowStmt(b, throwStmt, lc);
}
}
}
}
}

Expand Down

0 comments on commit e730d90

Please sign in to comment.