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. |