}
if (TokenInst) {
- changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
+ if (!isa<TerminatorInst>(TokenInst))
+ changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
} else {
// Get the list of successors of this block.
std::vector<BasicBlock *> Succs(succ_begin(BB), succ_end(BB));