From b2cfe502a8dd21eb048bc96c961d95d3e497485f Mon Sep 17 00:00:00 2001 From: Brian Railing Date: Thu, 22 Aug 2019 21:59:17 -0400 Subject: [PATCH] LLVM Pass - Remove assert on blocks without predecessors This is possible in C++ code, just unreachable. Apparently the compiler did not consider the block dead and left it. #216 --- llvm-contech/BufferCheckAnalysis.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm-contech/BufferCheckAnalysis.cpp b/llvm-contech/BufferCheckAnalysis.cpp index 7e51d8d..f050ea8 100644 --- a/llvm-contech/BufferCheckAnalysis.cpp +++ b/llvm-contech/BufferCheckAnalysis.cpp @@ -277,8 +277,8 @@ namespace llvm if (pred_bb_states.size() == 0 && bb_val != entry_val) { - errs() << "BBCHK " << *bb << "\n"; - assert(pred_bb_states.size() > 0); + // Some C++ code generates unreachable blocks. + continue; } // get the initial current state