Skip to content

Commit

Permalink
fix typos:
Browse files Browse the repository at this point in the history
1. remove unused logs
2. modify the default value of CG algorithm
  • Loading branch information
hanada committed Aug 14, 2023
1 parent caee1c9 commit 2bbfa09
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private static void analyzeArgs(CommandLine mCmd) {

int timeLimit = Integer.valueOf(mCmd.getOptionValue("time", "90"));
MyConfig.getInstance().setTimeLimit(timeLimit);
MyConfig.getInstance().setCallgraphAlgorithm(mCmd.getOptionValue("callgraphAlgorithm", "CHA"));
MyConfig.getInstance().setCallgraphAlgorithm(mCmd.getOptionValue("callgraphAlgorithm", "SPARK"));

String client = mCmd.getOptionValue("client", "MainClient");
MyConfig.getInstance().setClient(mCmd.getOptionValue("client", client));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,18 +573,20 @@ private void getExceptionCondition(SootMethod sootMethod, Unit unit, ExceptionIn
JIdentityStmt stmt = (JIdentityStmt) predUnit;
if(stmt.getRightOp() instanceof CaughtExceptionRef){
exceptionInfo.addCaughtValues(stmt.getRightOp());
// Log.error("1");
//TODO statistic
//analyze the try-catch block of this exception
List<Unit> caughtUnits = getTryCatchUnits(sootMethod, predUnit);
SootClass caughtType = getCaughtExceptionType(sootMethod, predUnit);
{
List<Unit> caughtUnits = getTryCatchUnits(sootMethod, predUnit);
SootClass caughtType = getCaughtExceptionType(sootMethod, predUnit);

for(Unit caughtUnit: caughtUnits) {
boolean invocationThrowThatException = isInvocationThrowThatException(caughtType,caughtUnit);
if(invocationThrowThatException==false) continue;
for (ValueBox vb : caughtUnit.getUseBoxes()) {
extendRelatedValues(sootMethod,SootUtils.getUnitListFromMethod(sootMethod), exceptionInfo, caughtUnit, vb.getValue(), new ArrayList<>(), getCondHistory, fromThrow);
for (Unit caughtUnit : caughtUnits) {
boolean invocationThrowThatException = isInvocationThrowThatException(caughtType, caughtUnit);
if (invocationThrowThatException == false) continue;
for (ValueBox vb : caughtUnit.getUseBoxes()) {
extendRelatedValues(sootMethod, SootUtils.getUnitListFromMethod(sootMethod), exceptionInfo, caughtUnit, vb.getValue(), new ArrayList<>(), getCondHistory, fromThrow);
}
ifMeetTryCatch = true;
}
ifMeetTryCatch = true;
}
}
}
Expand Down Expand Up @@ -645,16 +647,18 @@ private String extendRelatedValues(SootMethod sootMethod, List<Unit> allPreds, E
return "ParameterRef";
}else if(identityStmt.getRightOp() instanceof CaughtExceptionRef){
exceptionInfo.addCaughtValues(identityStmt.getRightOp());
//TODO statistic
//analyze the try-catch block of this exception
// Log.error("2");
List<Unit> caughtUnits = getTryCatchUnits(sootMethod, defUnit);
SootClass caughtType = getCaughtExceptionType(sootMethod, defUnit);
{
List<Unit> caughtUnits = getTryCatchUnits(sootMethod, defUnit);
SootClass caughtType = getCaughtExceptionType(sootMethod, defUnit);

for(Unit caughtUnit: caughtUnits) {
boolean invocationThrowThatException = isInvocationThrowThatException(caughtType,caughtUnit);
if(invocationThrowThatException==false) continue;
for (ValueBox vb : caughtUnit.getUseBoxes()) {
extendRelatedValues(sootMethod,SootUtils.getUnitListFromMethod(sootMethod), exceptionInfo, caughtUnit, vb.getValue(), new ArrayList<>(), getCondHistory, fromThrow);
for (Unit caughtUnit : caughtUnits) {
boolean invocationThrowThatException = isInvocationThrowThatException(caughtType, caughtUnit);
if (invocationThrowThatException == false) continue;
for (ValueBox vb : caughtUnit.getUseBoxes()) {
extendRelatedValues(sootMethod, SootUtils.getUnitListFromMethod(sootMethod), exceptionInfo, caughtUnit, vb.getValue(), new ArrayList<>(), getCondHistory, fromThrow);
}
}
}
return "CaughtExceptionRef";
Expand Down

0 comments on commit 2bbfa09

Please sign in to comment.