diff options
author | van Hauser <vh@thc.org> | 2020-03-10 06:44:24 +0100 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-03-10 06:44:24 +0100 |
commit | f6787312346b66f52148f5daa8c5ffb08d92407f (patch) | |
tree | aa8b6122c6f18a72fa7eacb9cd23db678aa2ef59 /llvm_mode/MarkNodes.cc | |
parent | e04d2a6efab8c6501870961a0b4be35afddc45ae (diff) | |
download | afl++-f6787312346b66f52148f5daa8c5ffb08d92407f.tar.gz |
afl-tmin is fixed via default initialization in forkserver
Diffstat (limited to 'llvm_mode/MarkNodes.cc')
-rw-r--r-- | llvm_mode/MarkNodes.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm_mode/MarkNodes.cc b/llvm_mode/MarkNodes.cc index 7b22bac0..b8587826 100644 --- a/llvm_mode/MarkNodes.cc +++ b/llvm_mode/MarkNodes.cc @@ -376,10 +376,10 @@ void MakeUniq(uint32_t now) { } -void MarkSubGraph(uint32_t ss, uint32_t tt) { +bool MarkSubGraph(uint32_t ss, uint32_t tt) { TopologicalSort(ss, tt); - if (TopoOrder.empty()) return; + if (TopoOrder.empty()) return false; for (uint32_t i : TopoOrder) { @@ -393,6 +393,11 @@ void MarkSubGraph(uint32_t ss, uint32_t tt) { MakeUniq(TopoOrder[i]); } + + // Check if there is an empty path. + if (NextMarked[tt].count(TopoOrder[0]) > 0) + return true; + return false; } @@ -417,13 +422,19 @@ void MarkVertice() { timeStamp = 0; uint32_t t = 0; + bool emptyPathExists = true; while (s != t) { - MarkSubGraph(DominatorTree::idom[t], t); + emptyPathExists &= MarkSubGraph(DominatorTree::idom[t], t); t = DominatorTree::idom[t]; } + + if (emptyPathExists) { + // Mark all exit blocks to catch the empty path. + Marked.insert(t_Pred[0].begin(), t_Pred[0].end()); + } } |