summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Verifier.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 5e2186d12a6..13da05ee302 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3113,8 +3113,13 @@ bool llvm::verifyModule(const Module &M, raw_ostream *OS) {
// Note that this function's return value is inverted from what you would
// expect of a function called "verify".
+ if (!V.verify(M) || Broken)
+ return true;
+
+ // Run the debug info verifier only if the regular verifier succeeds, since
+ // sometimes checks that have already failed will cause crashes here.
DebugInfoVerifier DIV(OS ? *OS : NullStr);
- return !V.verify(M) || !DIV.verify(M) || Broken;
+ return !DIV.verify(M);
}
namespace {
OpenPOWER on IntegriCloud