Fix FileCheck crash when fuzzy scanning starting at the end of the file.

llvm-svn: 90065
This commit is contained in:
Daniel Dunbar 2009-11-29 08:30:24 +00:00
parent 3d221f2fce
commit 53b95c4080

View File

@ -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),