Index: third_party/re2/re2/prog.cc |
diff --git a/third_party/re2/re2/prog.cc b/third_party/re2/re2/prog.cc |
index 499f560f8d64fc01752a3501f1f0bd9f14c3b803..ef9ef2386cd2edc5da510c9bb528eb7a70d064bc 100644 |
--- a/third_party/re2/re2/prog.cc |
+++ b/third_party/re2/re2/prog.cc |
@@ -25,7 +25,7 @@ |
set_out_opcode(out, kInstByteRange); |
lo_ = lo & 0xFF; |
hi_ = hi & 0xFF; |
- foldcase_ = foldcase & 0xFF; |
+ foldcase_ = foldcase; |
} |
void Prog::Inst::InitCapture(int cap, uint32 out) { |
@@ -295,15 +295,13 @@ |
} |
void Prog::MarkByteRange(int lo, int hi) { |
- DCHECK_GE(lo, 0); |
- DCHECK_GE(hi, 0); |
- DCHECK_LE(lo, 255); |
- DCHECK_LE(hi, 255); |
- DCHECK_LE(lo, hi); |
- if (0 < lo && lo <= 255) |
+ CHECK_GE(lo, 0); |
+ CHECK_GE(hi, 0); |
+ CHECK_LE(lo, 255); |
+ CHECK_LE(hi, 255); |
+ if (lo > 0) |
byterange_.Set(lo - 1); |
- if (0 <= hi && hi <= 255) |
- byterange_.Set(hi); |
+ byterange_.Set(hi); |
} |
void Prog::ComputeByteMap() { |
@@ -327,12 +325,12 @@ |
bytemap_range_ = bytemap_[255] + 1; |
unbytemap_ = new uint8[bytemap_range_]; |
for (int i = 0; i < 256; i++) |
- unbytemap_[bytemap_[i]] = static_cast<uint8>(i); |
+ unbytemap_[bytemap_[i]] = i; |
if (0) { // For debugging: use trivial byte map. |
for (int i = 0; i < 256; i++) { |
- bytemap_[i] = static_cast<uint8>(i); |
- unbytemap_[i] = static_cast<uint8>(i); |
+ bytemap_[i] = i; |
+ unbytemap_[i] = i; |
} |
bytemap_range_ = 256; |
LOG(INFO) << "Using trivial bytemap."; |