aboutsummaryrefslogtreecommitdiff
path: root/utils/FileCheck
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-29 08:30:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-29 08:30:24 +0000
commita76a7883b557c315f29dbf95155dd5ae0352fecf (patch)
treeec9bd08950c40fd9467dca8ce9a51006efd64286 /utils/FileCheck
parentcd188e9665b3ff50d57a91b267bb6294ed646539 (diff)
Fix FileCheck crash when fuzzy scanning starting at the end of the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r--utils/FileCheck/FileCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index 101ff24880..078028a115 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/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),