Skip to content

Commit

Permalink
Decrease jump table analysis bound
Browse files Browse the repository at this point in the history
  • Loading branch information
mxz297 committed Jun 14, 2016
1 parent f63ade7 commit 2c99375
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parseAPI/src/IndirectAnalyzer.C
Expand Up @@ -56,7 +56,7 @@ bool IndirectControlFlowAnalyzer::NewJumpTableAnalysis(std::vector<std::pair< Ad
bool ijt = jtp.IsJumpTable(g, bfc, target);
if (ijt) jtp.FillInOutEdges(target, jumpTableOutEdges);
}
//fprintf(stderr, "indirect jump at %lx with %d assignments and %d edges\n", block->last(), jtp.currentAssigns.size(), jumpTableOutEdges.size());
// fprintf(stderr, "indirect jump at %lx with %d assignments and %d edges\n", block->last(), jtp.currentAssigns.size(), jumpTableOutEdges.size());

outEdges.insert(outEdges.end(), jumpTableOutEdges.begin(), jumpTableOutEdges.end());
return !jumpTableOutEdges.empty();
Expand Down
3 changes: 1 addition & 2 deletions parseAPI/src/JumpTablePred.C
Expand Up @@ -116,7 +116,6 @@ static int AdjustGraphEntryAndExit(GraphPtr gp) {
return nodeCount;
}


GraphPtr JumpTablePred::BuildAnalysisGraph(set<ParseAPI::Edge*> &visitedEdges) {
GraphPtr newG = Graph::createGraph();

Expand Down Expand Up @@ -183,7 +182,7 @@ GraphPtr JumpTablePred::BuildAnalysisGraph(set<ParseAPI::Edge*> &visitedEdges) {
bool JumpTablePred::addNodeCallback(AssignmentPtr ap, set<ParseAPI::Edge*> &visitedEdges) {
if (!jumpTableFormat) return false;
if (currentAssigns.find(ap) != currentAssigns.end()) return true;
if (currentAssigns.size() > 200) return false;
if (currentAssigns.size() > 50) return false;
// For flags, we only analyze zf
if (ap->out().absloc().type() == Absloc::Register && ap->out().absloc().reg().regClass() == (unsigned int)x86::FLAG &&
ap->out().absloc().reg() != x86::zf && ap->out().absloc().reg() != x86_64::zf) {
Expand Down

0 comments on commit 2c99375

Please sign in to comment.