summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 101ff248808..078028a115c 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -398,7 +398,7 @@ void Pattern::PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
}
}
- if (BestQuality < 50) {
+ if (Best != StringRef::npos && BestQuality < 50) {
// Print the "possible intended match here" line if we found something
// reasonable.
SM.PrintMessage(SMLoc::getFromPointer(Buffer.data() + Best),
OpenPOWER on IntegriCloud