Skip to content

Commit

Permalink
remove static invoker check
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1t3p1g committed Feb 23, 2024
1 parent 8a48af2 commit 9a61b14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/main/java/tabby/analysis/switcher/InvokeExprSwitcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public class InvokeExprSwitcher extends AbstractJimpleValueSwitch {

@Override
public void caseStaticInvokeExpr(StaticInvokeExpr v) {
if(isNecessaryEdge("StaticInvoke", v)){
// if(isNecessaryEdge("StaticInvoke", v)){
generate(v);
buildCallRelationship(v);
}
// }
}

@Override
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/tabby/analysis/switcher/Switcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ public static TabbyVariable doInvokeExprAnalysis(
Map<Integer, TabbyVariable> args = Switcher.extractArgsFromInvokeExpr(invokeExpr, context);
// 检查当前的调用 是否需要分析 看入参、baseVar是否可控
List<Integer> pollutedPosition = pollutedPositionAnalysis(baseVar, args, context);
TabbyVariable firstPollutedVar = null;
boolean flag = false;
int index = 0;
for(Integer pos:pollutedPosition){
if(pos != PositionUtils.NOT_POLLUTED_POSITION){
if(index == 0){
firstPollutedVar = baseVar;
}else{
firstPollutedVar = args.get(index-1);
}
flag=true;
break;
}
index++;
}
// TabbyVariable firstPollutedVar = null;
// boolean flag = false;
// int index = 0;
// for(Integer pos:pollutedPosition){
// if(pos != PositionUtils.NOT_POLLUTED_POSITION){
// if(index == 0){
// firstPollutedVar = baseVar;
// }else{
// firstPollutedVar = args.get(index-1);
// }
// flag=true;
// break;
// }
// index++;
// }

if(!flag) return null;
// if(!flag) return null;
// baseVar,入参均不可控,返回值必不可控,无需做分析
// find target MethodRef
SootClass cls = invokeExpr.getMethod().getDeclaringClass();
Expand Down

0 comments on commit 9a61b14

Please sign in to comment.