Package soot.jimple

Examples of soot.jimple.InvokeStmt


        body.getUnits().insertBefore(assignStmt, insertionPoint);
       
        //exc.<init>(message)
        SootMethodRef cref = runtimeExceptionType.getSootClass().getMethod("<init>", Collections.singletonList(RefType.v("java.lang.String"))).makeRef();
        SpecialInvokeExpr constructorInvokeExpr = Jimple.v().newSpecialInvokeExpr(exceptionLocal, cref, StringConstant.v(guard.message));
        InvokeStmt initStmt = Jimple.v().newInvokeStmt(constructorInvokeExpr);
        body.getUnits().insertAfter(initStmt, assignStmt);
       
        if(options.guards().equals("print")) {
          //exc.printStackTrace();
          VirtualInvokeExpr printStackTraceExpr = Jimple.v().newVirtualInvokeExpr(exceptionLocal, Scene.v().getSootClass("java.lang.Throwable").getMethod("printStackTrace", Collections.emptyList()).makeRef());
          InvokeStmt printStackTraceStmt = Jimple.v().newInvokeStmt(printStackTraceExpr);
          body.getUnits().insertAfter(printStackTraceStmt, initStmt);
        } else if(options.guards().equals("throw")) {
          body.getUnits().insertAfter(Jimple.v().newThrowStmt(exceptionLocal), initStmt);
        } else {
          throw new RuntimeException("Invalid value for phase option (guarding): "+options.guards());
View Full Code Here


      body.getUnits().add(assignStmt);
     
      //exc.<init>(message)
      SootMethodRef cref = runtimeExceptionType.getSootClass().getMethod("<init>", Collections.singletonList(RefType.v("java.lang.String"))).makeRef();
      SpecialInvokeExpr constructorInvokeExpr = Jimple.v().newSpecialInvokeExpr(exceptionLocal, cref, StringConstant.v("Unresolved compilation error: Method "+getSignature()+" does not exist!"));
      InvokeStmt initStmt = Jimple.v().newInvokeStmt(constructorInvokeExpr);
      body.getUnits().insertAfter(initStmt, assignStmt);
     
      //throw exc
      body.getUnits().insertAfter(Jimple.v().newThrowStmt(exceptionLocal), initStmt);
View Full Code Here

                while (pairs.hasNext()) {
                    UnitValueBoxPair pair = (UnitValueBoxPair) pairs.next();

                    if (pair.getUnit() instanceof InvokeStmt) {
                        InvokeStmt useStmt = (InvokeStmt) pair.getUnit();

                        if (useStmt.getInvokeExpr() instanceof SpecialInvokeExpr) {
                            SpecialInvokeExpr constructorExpr = (SpecialInvokeExpr) useStmt
                                    .getInvokeExpr();

                            if (constructorExpr
                                    .getMethod()
                                    .getSignature()
View Full Code Here

TOP

Related Classes of soot.jimple.InvokeStmt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.