TempDescriptor[] tdArray = fc.readsTemps();
- for (int callerIdx = 0; callerIdx < tdArray.length; callerIdx++) {
- TempDescriptor paramDesc = tdArray[callerIdx];
+ for (int calleeParamIdx = 0; calleeParamIdx < tdArray.length; calleeParamIdx++) {
+ TempDescriptor paramDesc = tdArray[calleeParamIdx];
Set<Integer> paramIDs = getReachableParamIndexSet(og, paramDesc);
while (paramIter.hasNext()) {
Integer paramIdx = paramIter.next();
HashSet<EffectsKey> newSet = callee.getEffects().getReadTable()
- .get(paramIdx);
- effectsSet.addReadingEffectsSet(callerIdx, newSet);
+ .get(calleeParamIdx);
+ effectsSet.addReadingEffectsSet(paramIdx, newSet);
}
// handle write effects
while (paramIter.hasNext()) {
Integer paramIdx = paramIter.next();
HashSet<EffectsKey> newSet = callee.getEffects()
- .getWriteTable().get(paramIdx);
- effectsSet.addWritingEffectsSet(callerIdx, newSet);
+ .getWriteTable().get(calleeParamIdx);
+ effectsSet.addWritingEffectsSet(paramIdx, newSet);
}
}
} else {
ogCopy.resolveMethodCall(fc, possibleMd.isStatic(), pflatm, ogPotentialCallee, mc, null);
}
-
- MethodEffects meFlatCall=mapMethodContextToMethodEffects.get(mcNew);
- meFlatCall.analyzeFlatCall(ogMergeOfAllPossibleCalleeResults,fc,mcNew,meFlatCall);
ogMergeOfAllPossibleCalleeResults.merge(ogCopy);
+
+ MethodEffects meFlatCall=mapMethodContextToMethodEffects.get(mcNew);
+ me.analyzeFlatCall(ogMergeOfAllPossibleCalleeResults,fc,mc,meFlatCall);
}
+
}
og = ogMergeOfAllPossibleCalleeResults;
while (mcIter.hasNext()) {
MethodContext mc = mcIter.next();
MethodDescriptor md = (MethodDescriptor) mc.getDescriptor();
+
+ int startIdx=0;
+ if(!md.isStatic()){
+ startIdx=1;
+ }
MethodEffects me = mapMethodContextToMethodEffects.get(mc);
EffectsSet effectsSet = me.getEffects();
- bw.write("Method " + mc +"::"+mc.hashCode() + " :\n");
- for (int i = 0; i < md.numParameters(); i++) {
+ bw.write("Method " + mc +" :\n");
+ for (int i = startIdx; i < md.numParameters()+startIdx; i++) {
- String paramName = md.getParamName(i);
+ String paramName = md.getParamName(i-startIdx);
Set<EffectsKey> effectSet = effectsSet
.getReadingSet(i);