regexes are allowed to match empty things, e.g. {{.*}} in filecheck.
authorChris Lattner <sabre@nondot.org>
Sat, 9 Apr 2011 06:29:24 +0000 (06:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 9 Apr 2011 06:29:24 +0000 (06:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129193 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Regex.cpp

index 309ffb02dec684f87eb106e8074897fbf9b8401b..d293da07d684047543478817f57441ff3708324d 100644 (file)
@@ -82,7 +82,7 @@ bool Regex::match(StringRef String, SmallVectorImpl<StringRef> *Matches){
         Matches->push_back(StringRef());
         continue;
       }
-      assert(pm[i].rm_eo > pm[i].rm_so);
+      assert(pm[i].rm_eo >= pm[i].rm_so);
       Matches->push_back(StringRef(String.data()+pm[i].rm_so,
                                    pm[i].rm_eo-pm[i].rm_so));
     }