private void resolveInvoke(Collection<InvokeCallSite> list) { for (InvokeCallSite ics : list) { Set<Type> s = reachingBaseTypes.get(ics.base()); if (s == null || s.isEmpty()) { continue; if (ics.reachingTypes() != null) { assert ics.nullnessCode() != InvokeCallSite.MUST_BE_NULL; resolveStaticTypes(s, ics); continue; boolean mustNotBeNull = ics.nullnessCode() == InvokeCallSite.MUST_NOT_BE_NULL; boolean mustBeNull = ics.nullnessCode() == InvokeCallSite.MUST_BE_NULL; if (mustBeNull || (ics.nullnessCode() == InvokeCallSite.MAY_BE_NULL && (!invokeArgsToSize.containsKey(ics.argArray()) || !reachingArgTypes.containsKey(ics.argArray())))) { for (Type bType : resolveToClasses(s)) { assert bType instanceof RefType; while (mIt.hasNext()) { SootMethod sm = mIt.next(); cm.addVirtualEdge(ics.container(), ics.stmt(), sm, Kind.REFL_INVOKE, null); Set<Type> reachingTypes = reachingArgTypes.get(ics.argArray()); if (reachingTypes == null || !invokeArgsToSize.containsKey(ics.argArray())) { assert ics.nullnessCode() == InvokeCallSite.MUST_NOT_BE_NULL : ics; return; assert reachingTypes != null && invokeArgsToSize.containsKey(ics.argArray());
private void resolveStaticTypes(Set<Type> s, InvokeCallSite ics) { ArrayTypes at = ics.reachingTypes(); for (Type bType : resolveToClasses(s)) { SootClass baseClass = ((RefType) bType).getSootClass(); Iterator<SootMethod> mIt = getPublicMethodIterator(baseClass, at); while (mIt.hasNext()) { SootMethod sm = mIt.next(); cm.addVirtualEdge(ics.container(), ics.stmt(), sm, Kind.REFL_INVOKE, null); } } }
InvokeCallSite ics; if (argArray instanceof NullConstant) { ics = new InvokeCallSite(s, container, d, l); } else { if (analysisKey != container) { reachingArgTypes.possibleSizes.add(0); ics = new InvokeCallSite(s, container, d, l, reachingArgTypes, nullnessCode); } else { ics = new InvokeCallSite(s, container, d, l, argLocal, nullnessCode); invokeArgsToInvokeSite.put(argLocal, ics);