diff options
Diffstat (limited to 'llvm/lib/FuzzMutate/Operations.cpp')
| -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(); |

