diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-12 00:07:29 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-03-12 00:07:29 +0000 |
commit | 7dfb92b90b360198600477638a75fd45755d8b4e (patch) | |
tree | f1eb6faa0a80ab2fd48b00c9ef64675ab3bbe717 /llvm/utils/FileCheck/FileCheck.cpp | |
parent | 93e1ea167ef5bb703bb02a47c6412057a58af63a (diff) | |
download | bcm5719-llvm-7dfb92b90b360198600477638a75fd45755d8b4e.tar.gz bcm5719-llvm-7dfb92b90b360198600477638a75fd45755d8b4e.zip |
Fix FileCheck: substr() expect the length of the string as 2nd arg
The code assumed that substr() was taking start,end while it takes
start,length.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231988
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 146b5121ac5..f7c0524a221 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -1053,7 +1053,6 @@ size_t CheckString::Check(const SourceMgr &SM, StringRef Buffer, PrintCheckFailed(SM, *this, MatchBuffer, VariableTable); return StringRef::npos; } - MatchPos += LastPos; // Similar to the above, in "label-scan mode" we can't yet handle CHECK-NEXT // or CHECK-NOT @@ -1076,7 +1075,7 @@ size_t CheckString::Check(const SourceMgr &SM, StringRef Buffer, return StringRef::npos; } - return MatchPos; + return LastPos + MatchPos; } bool CheckString::CheckNext(const SourceMgr &SM, StringRef Buffer) const { |