private FullObjectSet(RefType declaredType) { Type type = AnySubType.v(declaredType); types = Collections.singleton(type); }
/** * A new local will be created and connected to {@link SparkLibraryHelper#node} of type {@link RefType}. For this new local * an allocation edge to {@link AnySubType} of its declared type will be added. */ @Override public void caseRefType(RefType t) { // var tmp; VarNode local = pag.makeLocalVarNode(new Object(), t, method); // new T(); AllocNode alloc = pag.makeAllocNode(new Object(), AnySubType.v(t), method); // tmp = new T(); pag.addAllocEdge(alloc, local); // x = tmp; pag.addEdge(local, node); }
final public Node caseDefaultClassLoader() { AllocNode a = pag.makeAllocNode(PointsToAnalysis.DEFAULT_CLASS_LOADER, AnySubType.v(rtClassLoader), null); VarNode v = pag.makeGlobalVarNode(PointsToAnalysis.DEFAULT_CLASS_LOADER_LOCAL, rtClassLoader); pag.addEdge(a, v); return v; }
CLASSLOADERCLASS = AnySubType.v(RefType.v("java.lang.ClassLoader")); PROCESSCLASS = AnySubType.v(RefType.v("java.lang.Process")); THREADCLASS = AnySubType.v(RefType.v("java.lang.Thread")); LEASTCLASS = AnySubType.v(RefType.v("java.lang.Object")); FILESYSTEMCLASS = AnySubType.v(RefType.v("java.io.FileSystem")); PRIVILEGEDACTIONEXCEPTION = AnySubType.v(RefType.v("java.security.PrivilegedActionException"));
final public Node casePrivilegedActionException() { AllocNode a = pag.makeAllocNode(PointsToAnalysis.PRIVILEGED_ACTION_EXCEPTION, AnySubType.v(RefType.v("java.security.PrivilegedActionException")), null); VarNode v = pag.makeGlobalVarNode(PointsToAnalysis.PRIVILEGED_ACTION_EXCEPTION_LOCAL, RefType.v("java.security.PrivilegedActionException")); pag.addEdge(a, v); return v; }
AllocNode alloc = pag.makeAllocNode(new Object(), AnySubType.v((RefType) at.baseType), method);
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; } }
allThrowablesSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Throwable"))); ALL_THROWABLES = registerSetIfNew(allThrowablesSet, null); resolveClassErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.ClassFormatError"))); initializationErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Error"))); INITIALIZATION_ERRORS = registerSetIfNew(initializationErrorSet, null);
private FullObjectSet( RefType declaredType ) { AnySubType type = AnySubType.v( declaredType ); types = Collections.singleton( type ); }
private FullObjectSet( RefType declaredType ) { AnySubType type = AnySubType.v( declaredType ); types = Collections.singleton( type ); }
AnySubType.v( RefType.v("java.lang.ClassLoader") ); AnySubType.v( RefType.v("java.lang.Process") ); AnySubType.v( RefType.v( "java.lang.Thread")); AnySubType.v( RefType.v( "java.lang.Object" ) ); AnySubType.v( RefType.v("java.io.FileSystem") ); AnySubType.v( RefType.v("java.security.PrivilegedActionException") );
AnySubType.v( RefType.v("java.lang.ClassLoader") ); AnySubType.v( RefType.v("java.lang.Process") ); AnySubType.v( RefType.v( "java.lang.Thread")); AnySubType.v( RefType.v( "java.lang.Object" ) ); AnySubType.v( RefType.v("java.io.FileSystem") ); AnySubType.v( RefType.v("java.security.PrivilegedActionException") );
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; } }
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; } }
allThrowablesSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Throwable"))); ALL_THROWABLES = registerSetIfNew(allThrowablesSet, null); resolveClassErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.ClassFormatError"))); resolveClassErrorSet.add(Scene.v().getRefType("java.lang.IllegalAccessError")); resolveClassErrorSet.add(Scene.v().getRefType("java.lang.IncompatibleClassChangeError")); initializationErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Error"))); INITIALIZATION_ERRORS = registerSetIfNew(initializationErrorSet, null);
allThrowablesSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Throwable"))); ALL_THROWABLES = registerSetIfNew(allThrowablesSet, null); resolveClassErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.ClassFormatError"))); resolveClassErrorSet.add(Scene.v().getRefType("java.lang.IllegalAccessError")); resolveClassErrorSet.add(Scene.v().getRefType("java.lang.IncompatibleClassChangeError")); initializationErrorSet.add(AnySubType.v(Scene.v().getRefType("java.lang.Error"))); INITIALIZATION_ERRORS = registerSetIfNew(initializationErrorSet, null);