/** * Makes a new fast hierarchy is none is active, and returns the active fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if (!hasFastHierarchy()) { setFastHierarchy(new FastHierarchy()); } return getFastHierarchy(); }
protected boolean isThrowDeclared(Body b, SootClass throwClass) { if (hierarchy == null) { hierarchy = new FastHierarchy();
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType) { if (hierarchy == null) { hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()) { Trap trap = (Trap) it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())) { if (isThrowInStmtRange(b, (Stmt) trap.getBeginUnit(), (Stmt) trap.getEndUnit(), s)) { return true; } } } return false; }
public static soot.Local getThisGivenOuter(soot.Type sootType, HashMap getThisMap, soot.Body body, LocalGenerator lg, soot.Local t2) { if (InitialResolver.v().hierarchy() == null) { InitialResolver.v().hierarchy(new soot.FastHierarchy()); } soot.FastHierarchy fh = InitialResolver.v().hierarchy(); while (!fh.canStoreType(t2.getType(), sootType)) { soot.SootClass classToInvoke = ((soot.RefType) t2.getType()).getSootClass(); // make an access method and add it to that class for accessing // its private this$0 field soot.SootMethod methToInvoke = makeOuterThisAccessMethod(classToInvoke); // generate a local that corresponds to the invoke of that meth soot.Local t3 = lg.generateLocal(methToInvoke.getReturnType()); ArrayList methParams = new ArrayList(); methParams.add(t2); soot.Local res = getPrivateAccessFieldInvoke(methToInvoke.makeRef(), methParams, body, lg); soot.jimple.AssignStmt assign = soot.jimple.Jimple.v().newAssignStmt(t3, res); body.getUnits().add(assign); t2 = t3; } getThisMap.put(sootType, t2); return t2; }
Scene.v().setFastHierarchy(new FastHierarchy());
Scene.v().setFastHierarchy(new FastHierarchy());
public static soot.Local getThis(soot.Type sootType, soot.Body body, HashMap getThisMap, LocalGenerator lg) { InitialResolver.v().hierarchy(new soot.FastHierarchy());
Scene.v().setFastHierarchy(new FastHierarchy()); Scene.v().setFastHierarchy(new FastHierarchy());
Scene.v().setFastHierarchy(new FastHierarchy());
InitialResolver.v().hierarchy(new soot.FastHierarchy());
} else { if (InitialResolver.v().hierarchy() == null) { InitialResolver.v().hierarchy(new soot.FastHierarchy());
/** Constructs a new empty set given a list of all locals and types that may * ever be in the set. */ public LocalTypeSet( List<Local> locals, List<Type> types ) { super( locals.size() * types.size() ); this.locals = locals; this.types = types; if( !Scene.v().hasFastHierarchy() ) { Scene.v().setFastHierarchy( new FastHierarchy() ); } } /** Returns the number of the bit corresponding to the pair (l,t). */
/** Constructs a new empty set given a list of all locals and types that may * ever be in the set. */ public LocalTypeSet( List<Local> locals, List<Type> types ) { super( locals.size() * types.size() ); this.locals = locals; this.types = types; if( !Scene.v().hasFastHierarchy() ) { Scene.v().setFastHierarchy( new FastHierarchy() ); } } /** Returns the number of the bit corresponding to the pair (l,t). */
/** Makes a new fast hierarchy is none is active, and returns the active * fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if(!hasFastHierarchy() ) { setFastHierarchy( new FastHierarchy() ); } return getFastHierarchy(); } /**
/** Makes a new fast hierarchy is none is active, and returns the active * fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if(!hasFastHierarchy() ) { setFastHierarchy( new FastHierarchy() ); } return getFastHierarchy(); } /**
protected boolean isThrowDeclared(Body b, SootClass throwClass){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } // handles case when exception is RuntimeException or Error if (throwClass.equals(Scene.v().getSootClass("java.lang.RuntimeException")) || throwClass.equals(Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exception is a subclass of RuntimeException or Error if (hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.RuntimeException")) || hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exact exception is thrown if (b.getMethod().throwsException(throwClass)) return true; // handles case when a super type of the exception is thrown Iterator<SootClass> it = b.getMethod().getExceptions().iterator(); while (it.hasNext()){ SootClass nextEx = it.next(); if (hierarchy.isSubclass(throwClass, nextEx)) return true; } return false; }
protected boolean isThrowDeclared(Body b, SootClass throwClass){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } // handles case when exception is RuntimeException or Error if (throwClass.equals(Scene.v().getSootClass("java.lang.RuntimeException")) || throwClass.equals(Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exception is a subclass of RuntimeException or Error if (hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.RuntimeException")) || hierarchy.isSubclass(throwClass, Scene.v().getSootClass("java.lang.Error"))) return true; // handles case when exact exception is thrown if (b.getMethod().throwsException(throwClass)) return true; // handles case when a super type of the exception is thrown Iterator<SootClass> it = b.getMethod().getExceptions().iterator(); while (it.hasNext()){ SootClass nextEx = it.next(); if (hierarchy.isSubclass(throwClass, nextEx)) return true; } return false; }
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()){ Trap trap = (Trap)it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())){ if (isThrowInStmtRange(b, (Stmt)trap.getBeginUnit(), (Stmt)trap.getEndUnit(), s)) return true; } } return false; }
protected boolean isExceptionCaught(Body b, Stmt s, RefType throwType){ if (hierarchy == null){ hierarchy = new FastHierarchy(); } Iterator it = b.getTraps().iterator(); while (it.hasNext()){ Trap trap = (Trap)it.next(); if (trap.getException().getType().equals(throwType) || hierarchy.isSubclass(throwType.getSootClass(), (trap.getException().getType()).getSootClass())){ if (isThrowInStmtRange(b, (Stmt)trap.getBeginUnit(), (Stmt)trap.getEndUnit(), s)) return true; } } return false; }