@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"))); } }
@Override public void caseThrowStmt(ThrowStmt stmt) { usedAsObject = stmt.getOp() == l; doBreak = true; return; } };
public final void caseThrowStmt(ThrowStmt s) { statement = s; caseThrowStmt((Local) s.getOp()); } }
public ThrowStmt newThrowStmt(ThrowStmt s) { return new GThrowStmt(s.getOp()); }
public void caseThrowStmt(ThrowStmt s) { emitValue(s.getOp()); emit("athrow", -1); } });
public void caseThrowStmt(ThrowStmt stmt) { String varName = printValueAssignment(stmt.getOp(), "op"); printStmt(stmt, varName); }
@Override protected void internalTransform(Body b, String phaseName, Map<String, String> options) { LocalCreation lc = new LocalCreation(b.getLocals(), "ex"); for (Iterator<Unit> unitIt = b.getUnits().snapshotIterator(); unitIt.hasNext();) { Unit u = unitIt.next(); // Check for a null exception if (u instanceof ThrowStmt) { ThrowStmt throwStmt = (ThrowStmt) u; if (throwStmt.getOp() == NullConstant.v() || throwStmt.getOp().equals(IntConstant.v(0)) || throwStmt.getOp().equals(LongConstant.v(0))) { createThrowStmt(b, throwStmt, lc); } } } }
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)"); } } } }
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)"); } } } }
public void caseThrowStmt(ThrowStmt stmt) { stmt.setOp(this.uv.visit(stmt.getOp(), RefType.v("java.lang.Throwable"), stmt)); }
@Override public void caseThrowStmt(ThrowStmt stmt) { Value exception = stmt.getOp(); constantV.setOrigStmt(stmt); Register exceptionReg = regAlloc.asImmediate(exception, constantV); addInsn(new Insn11x(Opcode.THROW, exceptionReg), stmt); }
public void analyseThrowStmt(ThrowStmt s) { Value op = (s).getOp(); if (op instanceof Local) { add_ThrownType(((Local) op).getType()); } else if (op instanceof FieldRef) { add_ThrownType(((FieldRef) op).getType()); } }
@Override final public void caseThrowStmt(ThrowStmt ts) { ts.getOp().apply(MethodNodeFactory.this); mpag.addOutEdge(getNode(), pag.nodeFactory().caseThrow()); } });
public ThrowableSet mightThrowExplicitly(ThrowStmt t) { Value thrownExpression = t.getOp(); Type thrownType = thrownExpression.getType(); if (thrownType == null || thrownType instanceof UnknownType) { // We can't identify the type of thrownExpression, so... return ThrowableSet.Manager.v().ALL_THROWABLES; } else if (thrownType instanceof NullType) { ThrowableSet result = ThrowableSet.Manager.v().EMPTY; result = result.add(ThrowableSet.Manager.v().NULL_POINTER_EXCEPTION); return result; } else if (!(thrownType instanceof RefType)) { throw new IllegalStateException("UnitThrowAnalysis StmtSwitch: type of throw argument is not a RefType!"); } else { ThrowableSet result = ThrowableSet.Manager.v().EMPTY; if (thrownExpression instanceof NewInvokeExpr) { // In this case, we know the exact type of the // argument exception. result = result.add((RefType) thrownType); } else { result = result.add(AnySubType.v((RefType) thrownType)); } return result; } }
Value throwee = ((ThrowStmt) s).getOp(); if (throwee instanceof Constant) { continue;
public void walk_stmt(ASTAnalysis a, Stmt s) { if (a.getAnalysisDepth() < ASTAnalysis.ANALYSE_STMTS) { return; } if (s instanceof DefinitionStmt) { DefinitionStmt ds = (DefinitionStmt) s; walk_value(a, ds.getRightOp()); walk_value(a, ds.getLeftOp()); a.analyseDefinitionStmt(ds); } else if (s instanceof ReturnStmt) { ReturnStmt rs = (ReturnStmt) s; walk_value(a, rs.getOp()); a.analyseReturnStmt(rs); } else if (s instanceof InvokeStmt) { InvokeStmt is = (InvokeStmt) s; walk_value(a, is.getInvokeExpr()); a.analyseInvokeStmt(is); } else if (s instanceof ThrowStmt) { ThrowStmt ts = (ThrowStmt) s; walk_value(a, ts.getOp()); a.analyseThrowStmt(ts); } else { a.analyseStmt(s); } }