From df58dd84182a78ac48e1199ca95e9ecbab9db1ea Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Wed, 15 Aug 2018 05:50:38 +0000 Subject: [PATCH] [NFC] Add sanitizing assertion to ICF tracker llvm-svn: 339751 --- llvm/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp b/llvm/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp index a5b6c54533ad..0e1591f42ad6 100644 --- a/llvm/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp +++ b/llvm/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp @@ -24,7 +24,9 @@ const Instruction * ImplicitControlFlowTracking::getFirstICFI(const BasicBlock *BB) { if (!KnownBlocks.count(BB)) fill(BB); - return FirstImplicitControlFlowInsts.lookup(BB); + auto *FirstICF = FirstImplicitControlFlowInsts.lookup(BB); + assert((!FirstICF || FirstICF->getParent() == BB) && "Inconsistent cache!"); + return FirstICF; } bool ImplicitControlFlowTracking::hasICF(const BasicBlock *BB) {