@Override public void caseThrowStmt(ThrowStmt stmt) { usedAsObject = stmt.getOp() == l; if (usedAsObject) { doBreak = true; } return; } });
protected void checkThrow(Body b, ThrowStmt ts) { if (isThrowDeclared(b, ((RefType) ts.getOp().getType()).getSootClass()) || isThrowFromCompiler(ts) || isExceptionCaught(b, ts, (RefType) ts.getOp().getType())) { return; } if (reporter != null) { reporter.reportError(new ExceptionCheckerError(b.getMethod(), ((RefType) ts.getOp().getType()).getSootClass(), ts, (SourceLnPosTag) ts.getOpBox().getTag("SourceLnPosTag"))); } }
protected boolean isThrowFromCompiler(ThrowStmt ts) { if (ts.hasTag("ThrowCreatedByCompilerTag")) { return true; } return false; }
@Override public void caseThrowStmt(ThrowStmt stmt) { // add constraint DalvikTyper.v().setType(stmt.getOpBox(), RefType.v("java.lang.Object"), true); }
public void convert(DavaBody body) { Iterator it = body.getUnits().iterator(); while (it.hasNext()) { Unit u = (Unit) it.next(); if (u instanceof ThrowStmt) { ValueBox opBox = ((ThrowStmt) u).getOpBox(); Value op = opBox.getValue(); if (op.getType() instanceof NullType) { opBox.setValue(new DNewInvokeExpr(npeRef, null, new ArrayList())); } } } } }
@Override public void caseThrowStmt(ThrowStmt stmt) { usedAsObject = stmt.getOp() == l; doBreak = true; return; } };
public void caseThrowStmt(ThrowStmt stmt) { if (stmt.getOp() instanceof Local) { TypeNode op = hierarchy.typeNode(((Local) stmt.getOp()).getType()); if (!op.hasAncestorOrSelf(hierarchy.typeNode(RefType.v("java.lang.Throwable")))) { if (fix) { stmt.setOp(insertCast((Local) stmt.getOp(), RefType.v("java.lang.Throwable"), stmt)); } else { error("Type Error(53)"); } } } }
protected void checkThrow(Body b, ThrowStmt ts){ if (isThrowDeclared(b, ((RefType)ts.getOp().getType()).getSootClass()) || isThrowFromCompiler(ts) || isExceptionCaught(b, ts, (RefType)ts.getOp().getType())) return; if (reporter != null){ reporter.reportError(new ExceptionCheckerError(b.getMethod(), ((RefType)ts.getOp().getType()).getSootClass(), ts, (SourceLnPosTag)ts.getOpBox().getTag("SourceLnPosTag"))); } }
public void caseThrowStmt(ThrowStmt s) { inThrowStmt(s); caseExprOrRefValueBox(s.getOpBox()); // decideCaseExprOrRef(s.getOp()); outThrowStmt(s); }
protected boolean isThrowFromCompiler(ThrowStmt ts){ if (ts.hasTag("ThrowCreatedByCompilerTag")) return true; return false; }
public final void caseThrowStmt(ThrowStmt s) { statement = s; caseThrowStmt((Local) s.getOp()); } }
public void caseThrowStmt(ThrowStmt stmt) { if (stmt.getOp() instanceof Local) { TypeNode op = hierarchy.typeNode(((Local) stmt.getOp()).getType()); if (!op.hasAncestorOrSelf(hierarchy.typeNode(RefType.v("java.lang.Throwable")))) { if (fix) { stmt.setOp(insertCast((Local) stmt.getOp(), RefType.v("java.lang.Throwable"), stmt)); } else { error("Type Error(53)"); } } } }
protected void checkThrow(Body b, ThrowStmt ts){ if (isThrowDeclared(b, ((RefType)ts.getOp().getType()).getSootClass()) || isThrowFromCompiler(ts) || isExceptionCaught(b, ts, (RefType)ts.getOp().getType())) return; if (reporter != null){ reporter.reportError(new ExceptionCheckerError(b.getMethod(), ((RefType)ts.getOp().getType()).getSootClass(), ts, (SourceLnPosTag)ts.getOpBox().getTag("SourceLnPosTag"))); } }
public soot.jimple.ThrowStmt newThrowStmt(Value op, ASTNode location) { soot.jimple.ThrowStmt stmt = Jimple.v().newThrowStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; }
protected boolean isThrowFromCompiler(ThrowStmt ts){ if (ts.hasTag("ThrowCreatedByCompilerTag")) return true; return false; }
public ThrowStmt newThrowStmt(ThrowStmt s) { return new GThrowStmt(s.getOp()); }
public void caseThrowStmt(ThrowStmt stmt) { if(stmt.getOp() instanceof Local) { TypeNode op = hierarchy.typeNode(((Local) stmt.getOp()).getType()); if(!op.hasAncestorOrSelf(hierarchy.typeNode(RefType.v("java.lang.Throwable")))) { if(fix) { stmt.setOp(insertCast((Local) stmt.getOp(), RefType.v("java.lang.Throwable"), stmt)); } else { error("Type Error(53)"); } } } }
/** * Throw Stmt Creation */ private void createThrow(polyglot.ast.Throw throwStmt) { soot.Value toThrow = base().createAggressiveExpr(throwStmt.expr(), false, false); soot.jimple.ThrowStmt throwSt = soot.jimple.Jimple.v().newThrowStmt(toThrow); body.getUnits().add(throwSt); Util.addLnPosTags(throwSt, throwStmt.position()); Util.addLnPosTags(throwSt.getOpBox(), throwStmt.expr().position()); }