diff --git a/src/main/java/soot/dexpler/DexBody.java b/src/main/java/soot/dexpler/DexBody.java index 52d06a66f43..469cc8714e3 100755 --- a/src/main/java/soot/dexpler/DexBody.java +++ b/src/main/java/soot/dexpler/DexBody.java @@ -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); @@ -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 diff --git a/src/main/java/soot/dexpler/DexNullThrowTransformer.java b/src/main/java/soot/dexpler/DexNullThrowTransformer.java index c2180c0a19b..a6764d516a6 100644 --- a/src/main/java/soot/dexpler/DexNullThrowTransformer.java +++ b/src/main/java/soot/dexpler/DexNullThrowTransformer.java @@ -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; @@ -80,6 +83,16 @@ protected void internalTransform(Body b, String phaseName, Map 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); + } + } + } } }