diff options
| author | Igor Laevsky <igmyrj@gmail.com> | 2017-12-13 11:45:53 +0000 |
|---|---|---|
| committer | Igor Laevsky <igmyrj@gmail.com> | 2017-12-13 11:45:53 +0000 |
| commit | 541f9707a51f9b4046928739130cb4853e8e09f4 (patch) | |
| tree | 047df176b7850bc035437eef26fdb549cebcdac7 /llvm/lib/FuzzMutate | |
| parent | f51f4d3623dab619d52a8cac4a8d0d69d38e3a81 (diff) | |
| download | bcm5719-llvm-541f9707a51f9b4046928739130cb4853e8e09f4.tar.gz bcm5719-llvm-541f9707a51f9b4046928739130cb4853e8e09f4.zip | |
[FuzzMutate] Correctly split landingpad blocks
Differential Revision: https://reviews.llvm.org/D41112
llvm-svn: 320571
Diffstat (limited to 'llvm/lib/FuzzMutate')
| -rw-r--r-- | llvm/lib/FuzzMutate/Operations.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/FuzzMutate/Operations.cpp b/llvm/lib/FuzzMutate/Operations.cpp index 92993480215..b842f6d64fb 100644 --- a/llvm/lib/FuzzMutate/Operations.cpp +++ b/llvm/lib/FuzzMutate/Operations.cpp @@ -142,9 +142,14 @@ OpDescriptor llvm::fuzzerop::splitBlockDescriptor(unsigned Weight) { auto buildSplitBlock = [](ArrayRef<Value *> Srcs, Instruction *Inst) { BasicBlock *Block = Inst->getParent(); BasicBlock *Next = Block->splitBasicBlock(Inst, "BB"); + + // If it was an exception handling block, we are done. + if (Block->isEHPad()) + return nullptr; + + // Loop back on this block by replacing the unconditional forward branch + // with a conditional with a backedge. if (Block != &Block->getParent()->getEntryBlock()) { - // Loop back on this block by replacing the unconditional forward branch - // with a conditional with a backedge. BranchInst::Create(Block, Next, Srcs[0], Block->getTerminator()); Block->getTerminator()->eraseFromParent(); |

