Skip to content

Commit

Permalink
stop keeping all invoke bases
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirayk committed Sep 24, 2022
1 parent 74b0f15 commit 4f9a3b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package boomerang.scene.sparse;

import boomerang.scene.sparse.aliasaware.AliasAwareSparseCFGBuilder;
import com.google.common.graph.GraphBuilder;
import com.google.common.graph.MutableGraph;
import com.google.common.graph.Traverser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public SparseAliasingCFG buildSparseCFG(
MutableGraph<Unit> mCFG = numberStmtsAndConvertToMutableGraph(unitGraph);
queryLog.stopCFGNumber();

// LOGGER.info(m.getName() + " original");
// logCFG(LOGGER, mCFG);
// LOGGER.info(m.getName() + " original");
// logCFG(LOGGER, mCFG);
// if (m.getName().equals("id")) {
Type typeOfQueryVar = SootAdapter.getTypeOfVal(queryVar);

Expand All @@ -60,8 +60,8 @@ public SparseAliasingCFG buildSparseCFG(
sparsify(mCFG, stmtsToKeep, head, tail);
}
queryLog.stopSparsify();
// LOGGER.info(m.getName() + " ta-sparse");
// logCFG(LOGGER, mCFG);
// LOGGER.info(m.getName() + " ta-sparse");
// logCFG(LOGGER, mCFG);
// }
return new SparseAliasingCFG(queryVar, mCFG, queryStmt, null, unitToNumber);
}
Expand Down Expand Up @@ -131,10 +131,6 @@ private boolean keepStmt(Unit unit, Type queryVarType) {
if (isInvokeBase(queryVarType, invokeExpr)) {
keep = true;
}
// always check invoke base because we need to know how it was allocated
if (invokeExpr instanceof AbstractInstanceInvokeExpr) {
handleInvokeBase(invokeExpr, queryVarType);
}
}
}
if (unit instanceof JAssignStmt) {
Expand All @@ -160,6 +156,14 @@ private boolean keepStmt(Unit unit, Type queryVarType) {
// left or right of the same type
if (isAssignableType(leftOp.getType(), queryVarType)
|| isAssignableType(rightOp.getType(), queryVarType)) {
if (stmt.containsInvokeExpr()) {
InvokeExpr invokeExpr = stmt.getInvokeExpr();
// always check invoke base if its beign assigned to the type we track, because we need to
// know how it was allocated
if (invokeExpr instanceof AbstractInstanceInvokeExpr) {
handleInvokeBase(invokeExpr, queryVarType);
}
}
keep = true;
}
}
Expand Down

0 comments on commit 4f9a3b8

Please sign in to comment.