From 541f9707a51f9b4046928739130cb4853e8e09f4 Mon Sep 17 00:00:00 2001 From: Igor Laevsky Date: Wed, 13 Dec 2017 11:45:53 +0000 Subject: [FuzzMutate] Correctly split landingpad blocks Differential Revision: https://reviews.llvm.org/D41112 llvm-svn: 320571 --- llvm/lib/FuzzMutate/Operations.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'llvm/lib/FuzzMutate') 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 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(); -- cgit v1.2.3