From cf60ab313a33b5e6a480311a9d5d2765b03c384d Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 7 Jun 2017 12:06:45 +0000 Subject: [FileCheck] Don't scan past the closing CHECK-DAG for CHECK-NOT inside CHECK-DAG If there's enough data in fron of it the skipped region would just become arbitrarily large, and we scan for the CHECK-NOT everywhere. llvm-svn: 304900 --- llvm/utils/FileCheck/FileCheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/utils/FileCheck/FileCheck.cpp') diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index f563cadc92c..9d808cc875c 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -1203,7 +1203,7 @@ size_t CheckString::CheckDag(const SourceMgr &SM, StringRef Buffer, // If there's CHECK-NOTs between two CHECK-DAGs or from CHECK to // CHECK-DAG, verify that there's no 'not' strings occurred in that // region. - StringRef SkippedRegion = Buffer.substr(LastPos, MatchPos); + StringRef SkippedRegion = Buffer.slice(LastPos, MatchPos); if (CheckNot(SM, SkippedRegion, NotStrings, VariableTable)) return StringRef::npos; // Clear "not strings". -- cgit v1.2.3