Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: third_party/re2/re2/bitstate.cc

Issue 1516543002: Update re2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated update instructions Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/re2/Makefile ('k') | third_party/re2/re2/compile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/bitstate.cc
diff --git a/third_party/re2/re2/bitstate.cc b/third_party/re2/re2/bitstate.cc
index 518d6420127aa1e41dcb6a77625b7b19fc313616..5740daa486679549cfb33ef569d35c6225c72cfa 100644
--- a/third_party/re2/re2/bitstate.cc
+++ b/third_party/re2/re2/bitstate.cc
@@ -94,7 +94,7 @@ BitState::~BitState() {
// If so, remember that it was visited so that the next time,
// we don't repeat the visit.
bool BitState::ShouldVisit(int id, const char* p) {
- uint n = id * (text_.size() + 1) + (p - text_.begin());
+ size_t n = id * (text_.size() + 1) + (p - text_.begin());
if (visited_[n/VisitedBits] & (1 << (n & (VisitedBits-1))))
return false;
visited_[n/VisitedBits] |= 1 << (n & (VisitedBits-1));
@@ -170,6 +170,8 @@ bool BitState::TrySearch(int id0, const char* p0) {
Prog::Inst* ip = prog_->inst(id);
switch (ip->opcode()) {
case kInstFail:
+ return false;
+
default:
LOG(DFATAL) << "Unexpected opcode: " << ip->opcode() << " arg " << arg;
return false;
@@ -270,7 +272,8 @@ bool BitState::TrySearch(int id0, const char* p0) {
if (submatch_[0].data() == NULL ||
(longest_ && p > submatch_[0].end())) {
for (int i = 0; i < nsubmatch_; i++)
- submatch_[i] = StringPiece(cap_[2*i], cap_[2*i+1] - cap_[2*i]);
+ submatch_[i].set(cap_[2*i],
+ static_cast<int>(cap_[2*i+1] - cap_[2*i]));
}
// If going for first match, we're done.
« no previous file with comments | « third_party/re2/re2/Makefile ('k') | third_party/re2/re2/compile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698