diff -Nru re2-20161101+dfsg/CMakeLists.txt re2-20170101+dfsg/CMakeLists.txt --- re2-20161101+dfsg/CMakeLists.txt 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/CMakeLists.txt 2016-12-13 11:22:01.000000000 +0000 @@ -128,4 +128,4 @@ ) install(FILES ${RE2_HEADERS} DESTINATION include/re2) -install(TARGETS re2 ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +install(TARGETS re2 ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff -Nru re2-20161101+dfsg/debian/changelog re2-20170101+dfsg/debian/changelog --- re2-20161101+dfsg/debian/changelog 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/changelog 2017-01-08 20:43:51.000000000 +0000 @@ -1,3 +1,10 @@ +re2 (20170101+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Bump copyright years. + + -- Stefano Rivera Mon, 09 Jan 2017 07:43:51 +1100 + re2 (20161101+dfsg-2) unstable; urgency=medium * Missed a 32-bit symbol change (an int -> size_t). diff -Nru re2-20161101+dfsg/debian/copyright re2-20170101+dfsg/debian/copyright --- re2-20161101+dfsg/debian/copyright 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/copyright 2017-01-08 20:43:51.000000000 +0000 @@ -16,9 +16,9 @@ have been stripped, as they are generated during building. Files: * -Copyright: 2002-2016, Google Inc., - 2014-2016, Samsung Electronics, - 2010-2016, Stefano Rivera +Copyright: 2002-2017, Google Inc., + 2014-2017, Samsung Electronics, + 2010-2017, Stefano Rivera License: BSD-3-google Files: util/utf.h util/rune.cc @@ -35,7 +35,7 @@ SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. Files: debian/* -Copyright: 2010-2016, Stefano Rivera +Copyright: 2010-2017, Stefano Rivera License: BSD-3-google License: BSD-3-google diff -Nru re2-20161101+dfsg/debian/.git-dpm re2-20170101+dfsg/debian/.git-dpm --- re2-20161101+dfsg/debian/.git-dpm 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/.git-dpm 2017-01-08 20:43:51.000000000 +0000 @@ -1,11 +1,11 @@ # see git-dpm(1) from git-dpm package -5a1cb767ffcd78825f755a221c59036414f2f0d9 -5a1cb767ffcd78825f755a221c59036414f2f0d9 -2816ff512eca4d939a0fb8cd7ad8834ff3653527 -2816ff512eca4d939a0fb8cd7ad8834ff3653527 -re2_20161101+dfsg.orig.tar.gz -efa288d72698066e9b154015eb2e1a2b389190f4 -315369 +3ef98ca013486e521fdd2778b6e5951e0004a7e7 +3ef98ca013486e521fdd2778b6e5951e0004a7e7 +93eb17004e7c3ec7429a265fe1494a318bd44ada +93eb17004e7c3ec7429a265fe1494a318bd44ada +re2_20170101+dfsg.orig.tar.xz +286141e0731a29d3b5a706734bf17fc6761b3009 +231080 debianTag="debian/%e%v" patchedTag="patched/%e%v" upstreamTag="upstream/%e%u" diff -Nru re2-20161101+dfsg/debian/patches/0001-Parallel-friendly-test-runner.patch re2-20170101+dfsg/debian/patches/0001-Parallel-friendly-test-runner.patch --- re2-20161101+dfsg/debian/patches/0001-Parallel-friendly-test-runner.patch 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/patches/0001-Parallel-friendly-test-runner.patch 2017-01-08 20:43:51.000000000 +0000 @@ -1,4 +1,4 @@ -From 21390da4fb4b8e81ec7364d652cb2cc1757ac97c Mon Sep 17 00:00:00 2001 +From 3577f00694aca3d9a518d06d2dc9d09e0a9df90c Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sat, 4 Jul 2015 13:12:35 -0700 Subject: Parallel-friendly test-runner diff -Nru re2-20161101+dfsg/debian/patches/0002-Use-Debian-s-Unicode-data.patch re2-20170101+dfsg/debian/patches/0002-Use-Debian-s-Unicode-data.patch --- re2-20161101+dfsg/debian/patches/0002-Use-Debian-s-Unicode-data.patch 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/patches/0002-Use-Debian-s-Unicode-data.patch 2017-01-08 20:43:51.000000000 +0000 @@ -1,4 +1,4 @@ -From 19a56c5fdafab3a81c70de2ea29534c52d1739b7 Mon Sep 17 00:00:00 2001 +From 538090a89c40ddb12ff1c3368aa746b53559d58f Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sat, 4 Jul 2015 13:12:36 -0700 Subject: Use Debian's Unicode data diff -Nru re2-20161101+dfsg/debian/patches/0003-Upstream-doesn-t-manage-a-SONAME-so-we-do.patch re2-20170101+dfsg/debian/patches/0003-Upstream-doesn-t-manage-a-SONAME-so-we-do.patch --- re2-20161101+dfsg/debian/patches/0003-Upstream-doesn-t-manage-a-SONAME-so-we-do.patch 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/patches/0003-Upstream-doesn-t-manage-a-SONAME-so-we-do.patch 2017-01-08 20:43:51.000000000 +0000 @@ -1,4 +1,4 @@ -From 5a1cb767ffcd78825f755a221c59036414f2f0d9 Mon Sep 17 00:00:00 2001 +From 3ef98ca013486e521fdd2778b6e5951e0004a7e7 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sat, 4 Jul 2015 13:12:37 -0700 Subject: Upstream doesn't manage a SONAME, so we do diff -Nru re2-20161101+dfsg/debian/rules re2-20170101+dfsg/debian/rules --- re2-20161101+dfsg/debian/rules 2016-11-10 23:59:43.000000000 +0000 +++ re2-20170101+dfsg/debian/rules 2017-01-08 20:43:51.000000000 +0000 @@ -11,12 +11,6 @@ dh $@ --parallel override_dh_auto_build: - rm -f util/valgrind.h - if [ -e /usr/include/valgrind/valgrind.h ]; then \ - ln -s /usr/include/valgrind/valgrind.h util; \ - else \ - touch util/valgrind.h; \ - fi dh_auto_build -- CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \ CPPFLAGS="$(CPPFLAGS)" REBUILD_TABLES=1 @@ -36,10 +30,6 @@ override_dh_gencontrol: dh_gencontrol -- -VBuilt-Using='$(shell dpkg-query -f'$${source:Package} (= $${source:Version})' -W unicode-data)' -override_dh_clean: - dh_clean - rm -f util/valgrind.h - VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+)\+dfsg-.*,\1,p') get-packaged-orig-source: diff -Nru re2-20161101+dfsg/kokoro/ubuntu/continuous-bazel.cfg re2-20170101+dfsg/kokoro/ubuntu/continuous-bazel.cfg --- re2-20161101+dfsg/kokoro/ubuntu/continuous-bazel.cfg 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/kokoro/ubuntu/continuous-bazel.cfg 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -build_file: "re2/kokoro/ubuntu/continuous-bazel.sh" diff -Nru re2-20161101+dfsg/kokoro/ubuntu/continuous-bazel.sh re2-20170101+dfsg/kokoro/ubuntu/continuous-bazel.sh --- re2-20161101+dfsg/kokoro/ubuntu/continuous-bazel.sh 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/kokoro/ubuntu/continuous-bazel.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#!/bin/bash -set -eux - -cd git/re2 - -bazel clean -bazel build --compilation_mode=dbg -- //... -bazel test --compilation_mode=dbg --test_output=errors -- //... \ - -//:dfa_test \ - -//:exhaustive1_test \ - -//:exhaustive2_test \ - -//:exhaustive3_test \ - -//:exhaustive_test \ - -//:random_test - -bazel clean -bazel build --compilation_mode=opt -- //... -bazel test --compilation_mode=opt --test_output=errors -- //... \ - -//:dfa_test \ - -//:exhaustive1_test \ - -//:exhaustive2_test \ - -//:exhaustive3_test \ - -//:exhaustive_test \ - -//:random_test - -exit 0 diff -Nru re2-20161101+dfsg/kokoro/ubuntu-bazel.cfg re2-20170101+dfsg/kokoro/ubuntu-bazel.cfg --- re2-20161101+dfsg/kokoro/ubuntu-bazel.cfg 1970-01-01 00:00:00.000000000 +0000 +++ re2-20170101+dfsg/kokoro/ubuntu-bazel.cfg 2016-12-13 11:22:01.000000000 +0000 @@ -0,0 +1 @@ +build_file: "re2/kokoro/ubuntu-bazel.sh" diff -Nru re2-20161101+dfsg/kokoro/ubuntu-bazel.sh re2-20170101+dfsg/kokoro/ubuntu-bazel.sh --- re2-20161101+dfsg/kokoro/ubuntu-bazel.sh 1970-01-01 00:00:00.000000000 +0000 +++ re2-20170101+dfsg/kokoro/ubuntu-bazel.sh 2016-12-13 11:22:01.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/bash +set -eux + +cd git/re2 + +bazel clean +bazel build --compilation_mode=dbg -- //... +bazel test --compilation_mode=dbg --test_output=errors -- //... \ + -//:dfa_test \ + -//:exhaustive1_test \ + -//:exhaustive2_test \ + -//:exhaustive3_test \ + -//:exhaustive_test \ + -//:random_test + +bazel clean +bazel build --compilation_mode=opt -- //... +bazel test --compilation_mode=opt --test_output=errors -- //... \ + -//:dfa_test \ + -//:exhaustive1_test \ + -//:exhaustive2_test \ + -//:exhaustive3_test \ + -//:exhaustive_test \ + -//:random_test + +exit 0 diff -Nru re2-20161101+dfsg/kokoro/windows/continuous-cmake.bat re2-20170101+dfsg/kokoro/windows/continuous-cmake.bat --- re2-20161101+dfsg/kokoro/windows/continuous-cmake.bat 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/kokoro/windows/continuous-cmake.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -CD git/re2 || EXIT /B 1 - -cmake -D CMAKE_BUILD_TYPE=Debug -G "Visual Studio 12 2013" -A x64 . || EXIT /B 1 -cmake --build . --config Debug --clean-first || EXIT /B 1 -ctest -C Debug --output-on-failure -E dfa^|exhaustive^|random || EXIT /B 1 - -cmake -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 12 2013" -A x64 . || EXIT /B 1 -cmake --build . --config Release --clean-first || EXIT /B 1 -ctest -C Release --output-on-failure -E dfa^|exhaustive^|random || EXIT /B 1 - -EXIT /B 0 diff -Nru re2-20161101+dfsg/kokoro/windows/continuous-cmake.cfg re2-20170101+dfsg/kokoro/windows/continuous-cmake.cfg --- re2-20161101+dfsg/kokoro/windows/continuous-cmake.cfg 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/kokoro/windows/continuous-cmake.cfg 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -build_file: "re2/kokoro/windows/continuous-cmake.bat" diff -Nru re2-20161101+dfsg/kokoro/windows-cmake.bat re2-20170101+dfsg/kokoro/windows-cmake.bat --- re2-20161101+dfsg/kokoro/windows-cmake.bat 1970-01-01 00:00:00.000000000 +0000 +++ re2-20170101+dfsg/kokoro/windows-cmake.bat 2016-12-13 11:22:01.000000000 +0000 @@ -0,0 +1,11 @@ +CD git/re2 || EXIT /B 1 + +cmake -D CMAKE_BUILD_TYPE=Debug -G "Visual Studio 12 2013" -A x64 . || EXIT /B 1 +cmake --build . --config Debug --clean-first || EXIT /B 1 +ctest -C Debug --output-on-failure -E dfa^|exhaustive^|random || EXIT /B 1 + +cmake -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 12 2013" -A x64 . || EXIT /B 1 +cmake --build . --config Release --clean-first || EXIT /B 1 +ctest -C Release --output-on-failure -E dfa^|exhaustive^|random || EXIT /B 1 + +EXIT /B 0 diff -Nru re2-20161101+dfsg/kokoro/windows-cmake.cfg re2-20170101+dfsg/kokoro/windows-cmake.cfg --- re2-20161101+dfsg/kokoro/windows-cmake.cfg 1970-01-01 00:00:00.000000000 +0000 +++ re2-20170101+dfsg/kokoro/windows-cmake.cfg 2016-12-13 11:22:01.000000000 +0000 @@ -0,0 +1 @@ +build_file: "re2/kokoro/windows-cmake.bat" diff -Nru re2-20161101+dfsg/re2/bitstate.cc re2-20170101+dfsg/re2/bitstate.cc --- re2-20161101+dfsg/re2/bitstate.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/bitstate.cc 2016-12-13 11:22:01.000000000 +0000 @@ -324,7 +324,7 @@ submatch_ = submatch; nsubmatch_ = nsubmatch; for (int i = 0; i < nsubmatch_; i++) - submatch_[i] = NULL; + submatch_[i] = StringPiece(); // Allocate scratch space. nvisited_ = (prog_->size() * (text.size()+1) + VisitedBits-1) / VisitedBits; diff -Nru re2-20161101+dfsg/re2/dfa.cc re2-20170101+dfsg/re2/dfa.cc --- re2-20161101+dfsg/re2/dfa.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/dfa.cc 2016-12-13 11:22:01.000000000 +0000 @@ -1891,7 +1891,7 @@ // Pick out start state for unanchored search // at beginning of text. RWLocker l(&cache_mutex_); - SearchParams params(NULL, NULL, &l); + SearchParams params(StringPiece(), StringPiece(), &l); params.anchored = false; if (!AnalyzeSearch(¶ms) || params.start <= SpecialStateMax) return 0; @@ -1950,7 +1950,7 @@ // Pick out start state for anchored search at beginning of text. RWLocker l(&cache_mutex_); - SearchParams params(NULL, NULL, &l); + SearchParams params(StringPiece(), StringPiece(), &l); params.anchored = true; if (!AnalyzeSearch(¶ms)) return false; diff -Nru re2-20161101+dfsg/re2/fuzzing/re2_fuzzer.cc re2-20170101+dfsg/re2/fuzzing/re2_fuzzer.cc --- re2-20161101+dfsg/re2/fuzzing/re2_fuzzer.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/fuzzing/re2_fuzzer.cc 2016-12-13 11:22:01.000000000 +0000 @@ -21,9 +21,10 @@ return; // Don't waste time fuzzing high-fanout programs. + // (They can also cause bug reports due to fuzzer timeouts.) std::map histogram; int fanout = re.ProgramFanout(&histogram); - if (fanout > 10) + if (fanout > 9) return; StringPiece sp1, sp2, sp3, sp4; diff -Nru re2-20161101+dfsg/re2/parse.cc re2-20170101+dfsg/re2/parse.cc --- re2-20161101+dfsg/re2/parse.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/parse.cc 2016-12-13 11:22:01.000000000 +0000 @@ -1289,7 +1289,7 @@ } status->set_code(kRegexpBadUTF8); - status->set_error_arg(NULL); + status->set_error_arg(StringPiece()); return -1; } @@ -1333,12 +1333,12 @@ if (s->size() < 1 || (*s)[0] != '\\') { // Should not happen - caller always checks. status->set_code(kRegexpInternalError); - status->set_error_arg(NULL); + status->set_error_arg(StringPiece()); return false; } if (s->size() < 2) { status->set_code(kRegexpTrailingBackslash); - status->set_error_arg(NULL); + status->set_error_arg(StringPiece()); return false; } Rune c, c1; @@ -1793,7 +1793,7 @@ if (s->size() == 0 || (*s)[0] != '[') { // Caller checked this. status->set_code(kRegexpInternalError); - status->set_error_arg(NULL); + status->set_error_arg(StringPiece()); return false; } bool negated = false; @@ -2108,9 +2108,9 @@ return ps.DoFinish(); } - StringPiece lastunary = NULL; + StringPiece lastunary = StringPiece(); while (t.size() > 0) { - StringPiece isunary = NULL; + StringPiece isunary = StringPiece(); switch (t[0]) { default: { Rune r; @@ -2133,7 +2133,7 @@ if (!ps.DoLeftParenNoCapture()) return NULL; } else { - if (!ps.DoLeftParen(NULL)) + if (!ps.DoLeftParen(StringPiece())) return NULL; } t.remove_prefix(1); // '(' diff -Nru re2-20161101+dfsg/re2/re2.cc re2-20170101+dfsg/re2/re2.cc --- re2-20161101+dfsg/re2/re2.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/re2.cc 2016-12-13 11:22:01.000000000 +0000 @@ -785,7 +785,7 @@ // Zero submatches that don't exist in the regexp. for (int i = ncap; i < nsubmatch; i++) - submatch[i] = NULL; + submatch[i] = StringPiece(); return true; } diff -Nru re2-20161101+dfsg/re2/set.h re2-20170101+dfsg/re2/set.h --- re2-20161101+dfsg/re2/set.h 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/set.h 2016-12-13 11:22:01.000000000 +0000 @@ -41,6 +41,7 @@ // Match returns true if text matches any of the regexps in the set. // If so, it fills v (if not NULL) with the indices of the matching regexps. + // Callers must not expect v to be sorted. bool Match(const StringPiece& text, std::vector* v) const; private: diff -Nru re2-20161101+dfsg/re2/simplify.cc re2-20170101+dfsg/re2/simplify.cc --- re2-20161101+dfsg/re2/simplify.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/simplify.cc 2016-12-13 11:22:01.000000000 +0000 @@ -589,12 +589,12 @@ return Regexp::Plus(re->Incref(), f); // General case: x{4,} is xxxx+ - Regexp* nre = new Regexp(kRegexpConcat, f); - nre->AllocSub(min); - Regexp** nre_subs = nre->sub(); + Regexp** nre_subs = new Regexp*[min]; for (int i = 0; i < min-1; i++) nre_subs[i] = re->Incref(); nre_subs[min-1] = Regexp::Plus(re->Incref(), f); + Regexp* nre = Regexp::Concat(nre_subs, min, f); + delete[] nre_subs; return nre; } @@ -613,11 +613,11 @@ // Build leading prefix: xx. Capturing only on the last one. Regexp* nre = NULL; if (min > 0) { - nre = new Regexp(kRegexpConcat, f); - nre->AllocSub(min); - Regexp** nre_subs = nre->sub(); + Regexp** nre_subs = new Regexp*[min]; for (int i = 0; i < min; i++) nre_subs[i] = re->Incref(); + nre = Regexp::Concat(nre_subs, min, f); + delete[] nre_subs; } // Build and attach suffix: (x(x(x)?)?)? diff -Nru re2-20161101+dfsg/re2/testing/backtrack.cc re2-20170101+dfsg/re2/testing/backtrack.cc --- re2-20161101+dfsg/re2/testing/backtrack.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/backtrack.cc 2016-12-13 11:22:01.000000000 +0000 @@ -126,7 +126,7 @@ submatch_ = &sp0; nsubmatch_ = 1; } - submatch_[0] = NULL; + submatch_[0] = StringPiece(); // Allocate new visited_ bitmap -- size is proportional // to text, so have to reallocate on each call to Search. diff -Nru re2-20161101+dfsg/re2/testing/dfa_test.cc re2-20170101+dfsg/re2/testing/dfa_test.cc --- re2-20161101+dfsg/re2/testing/dfa_test.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/dfa_test.cc 2016-12-13 11:22:01.000000000 +0000 @@ -192,14 +192,12 @@ for (int i = 0; i < 10; i++) { bool matched = false; bool failed = false; - matched = prog->SearchDFA(match, NULL, - Prog::kUnanchored, Prog::kFirstMatch, - NULL, &failed, NULL); + matched = prog->SearchDFA(match, StringPiece(), Prog::kUnanchored, + Prog::kFirstMatch, NULL, &failed, NULL); CHECK(!failed); CHECK(matched); - matched = prog->SearchDFA(no_match, NULL, - Prog::kUnanchored, Prog::kFirstMatch, - NULL, &failed, NULL); + matched = prog->SearchDFA(no_match, StringPiece(), Prog::kUnanchored, + Prog::kFirstMatch, NULL, &failed, NULL); CHECK(!failed); CHECK(!matched); } @@ -226,14 +224,12 @@ for (int i = 0; i < 2; i++) { bool matched = false; bool failed = false; - matched = prog->SearchDFA(match, NULL, - Prog::kUnanchored, Prog::kFirstMatch, - NULL, &failed, NULL); + matched = prog->SearchDFA(match, StringPiece(), Prog::kUnanchored, + Prog::kFirstMatch, NULL, &failed, NULL); CHECK(!failed); CHECK(matched); - matched = prog->SearchDFA(no_match, NULL, - Prog::kUnanchored, Prog::kFirstMatch, - NULL, &failed, NULL); + matched = prog->SearchDFA(no_match, StringPiece(), Prog::kUnanchored, + Prog::kFirstMatch, NULL, &failed, NULL); CHECK(!failed); CHECK(!matched); } @@ -306,7 +302,8 @@ Prog *prog = re->CompileToReverseProg(0); CHECK(prog); bool failed = false; - bool matched = prog->SearchDFA(t.text, NULL, Prog::kUnanchored, Prog::kFirstMatch, NULL, &failed, NULL); + bool matched = prog->SearchDFA(t.text, StringPiece(), Prog::kUnanchored, + Prog::kFirstMatch, NULL, &failed, NULL); if (matched != t.match) { LOG(ERROR) << t.regexp << " on " << t.text << ": want " << t.match; nfail++; diff -Nru re2-20161101+dfsg/re2/testing/re2_test.cc re2-20170101+dfsg/re2/testing/re2_test.cc --- re2-20161101+dfsg/re2/testing/re2_test.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/re2_test.cc 2016-12-13 11:22:01.000000000 +0000 @@ -1458,7 +1458,7 @@ EXPECT_TRUE(re.Match(null, 0, null.size(), RE2::UNANCHORED, matches, arraysize(matches))); for (int i = 0; i < arraysize(matches); i++) { - EXPECT_TRUE(matches[i] == NULL); + EXPECT_TRUE(matches[i] == StringPiece()); EXPECT_TRUE(matches[i].data() == NULL); // always null EXPECT_TRUE(matches[i] == ""); } @@ -1469,16 +1469,16 @@ StringPiece empty(""); EXPECT_TRUE(re.Match(empty, 0, empty.size(), RE2::UNANCHORED, matches, arraysize(matches))); - EXPECT_TRUE(matches[0] == NULL); + EXPECT_TRUE(matches[0] == StringPiece()); EXPECT_TRUE(matches[0].data() != NULL); // empty, not null EXPECT_TRUE(matches[0] == ""); - EXPECT_TRUE(matches[1] == NULL); + EXPECT_TRUE(matches[1] == StringPiece()); EXPECT_TRUE(matches[1].data() != NULL); // empty, not null EXPECT_TRUE(matches[1] == ""); - EXPECT_TRUE(matches[2] == NULL); + EXPECT_TRUE(matches[2] == StringPiece()); EXPECT_TRUE(matches[2].data() == NULL); EXPECT_TRUE(matches[2] == ""); - EXPECT_TRUE(matches[3] == NULL); + EXPECT_TRUE(matches[3] == StringPiece()); EXPECT_TRUE(matches[3].data() == NULL); EXPECT_TRUE(matches[3] == ""); } diff -Nru re2-20161101+dfsg/re2/testing/regexp_benchmark.cc re2-20170101+dfsg/re2/testing/regexp_benchmark.cc --- re2-20161101+dfsg/re2/testing/regexp_benchmark.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/regexp_benchmark.cc 2016-12-13 11:22:01.000000000 +0000 @@ -886,7 +886,7 @@ Prog* prog = re->CompileToProg(0); CHECK(prog); bool failed = false; - CHECK_EQ(prog->SearchDFA(text, NULL, anchor, Prog::kFirstMatch, + CHECK_EQ(prog->SearchDFA(text, StringPiece(), anchor, Prog::kFirstMatch, NULL, &failed, NULL), expect_match); CHECK(!failed); @@ -902,7 +902,8 @@ CHECK(re); Prog* prog = re->CompileToProg(0); CHECK(prog); - CHECK_EQ(prog->SearchNFA(text, NULL, anchor, Prog::kFirstMatch, NULL, 0), + CHECK_EQ(prog->SearchNFA(text, StringPiece(), anchor, Prog::kFirstMatch, + NULL, 0), expect_match); delete prog; re->Decref(); @@ -974,8 +975,8 @@ CHECK(prog); for (int i = 0; i < iters; i++) { bool failed = false; - CHECK_EQ(prog->SearchDFA(text, NULL, anchor, - Prog::kFirstMatch, NULL, &failed, NULL), + CHECK_EQ(prog->SearchDFA(text, StringPiece(), anchor, Prog::kFirstMatch, + NULL, &failed, NULL), expect_match); CHECK(!failed); } @@ -990,7 +991,8 @@ Prog* prog = re->CompileToProg(0); CHECK(prog); for (int i = 0; i < iters; i++) { - CHECK_EQ(prog->SearchNFA(text, NULL, anchor, Prog::kFirstMatch, NULL, 0), + CHECK_EQ(prog->SearchNFA(text, StringPiece(), anchor, Prog::kFirstMatch, + NULL, 0), expect_match); } delete prog; @@ -1059,7 +1061,8 @@ Prog* prog = re->CompileToProg(0); CHECK(prog); StringPiece sp[4]; // 4 because sp[0] is whole match. - CHECK(prog->SearchNFA(text, NULL, Prog::kAnchored, Prog::kFullMatch, sp, 4)); + CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored, + Prog::kFullMatch, sp, 4)); delete prog; re->Decref(); } @@ -1130,7 +1133,8 @@ CHECK(prog); StringPiece sp[4]; // 4 because sp[0] is whole match. for (int i = 0; i < iters; i++) { - CHECK(prog->SearchNFA(text, NULL, Prog::kAnchored, Prog::kFullMatch, sp, 4)); + CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored, + Prog::kFullMatch, sp, 4)); } delete prog; re->Decref(); @@ -1202,7 +1206,8 @@ Prog* prog = re->CompileToProg(0); CHECK(prog); StringPiece sp[2]; // 2 because sp[0] is whole match. - CHECK(prog->SearchNFA(text, NULL, Prog::kAnchored, Prog::kFullMatch, sp, 2)); + CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored, + Prog::kFullMatch, sp, 2)); delete prog; re->Decref(); } @@ -1260,7 +1265,8 @@ CHECK(prog); StringPiece sp[2]; // 2 because sp[0] is whole match. for (int i = 0; i < iters; i++) { - CHECK(prog->SearchNFA(text, NULL, Prog::kAnchored, Prog::kFullMatch, sp, 2)); + CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored, + Prog::kFullMatch, sp, 2)); } delete prog; re->Decref(); diff -Nru re2-20161101+dfsg/re2/testing/string_generator.cc re2-20170101+dfsg/re2/testing/string_generator.cc --- re2-20161101+dfsg/re2/testing/string_generator.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/string_generator.cc 2016-12-13 11:22:01.000000000 +0000 @@ -85,7 +85,7 @@ CHECK(hasnext_); if (generate_null_) { generate_null_ = false; - sp_ = NULL; + sp_ = StringPiece(); return sp_; } s_.clear(); diff -Nru re2-20161101+dfsg/re2/testing/tester.cc re2-20170101+dfsg/re2/testing/tester.cc --- re2-20161101+dfsg/re2/testing/tester.cc 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/tester.cc 2016-12-13 11:22:01.000000000 +0000 @@ -473,7 +473,7 @@ // StringPiece(text.begin() - 1, 0). Oops. for (int i = 0; i < nsubmatch; i++) if (result->submatch[i].begin() == text.begin() - 1) - result->submatch[i] = NULL; + result->submatch[i] = StringPiece(); delete[] argptr; delete[] a; break; diff -Nru re2-20161101+dfsg/re2/testing/tester.h re2-20170101+dfsg/re2/testing/tester.h --- re2-20161101+dfsg/re2/testing/tester.h 2016-10-24 13:23:04.000000000 +0000 +++ re2-20170101+dfsg/re2/testing/tester.h 2016-12-13 11:22:01.000000000 +0000 @@ -72,7 +72,7 @@ void LogMatch(const char* prefix, Engine e, const StringPiece& text, const StringPiece& context, Prog::Anchor anchor); - const StringPiece& regexp_str_; // regexp being tested + const StringPiece regexp_str_; // regexp being tested Prog::MatchKind kind_; // kind of match Regexp::ParseFlags flags_; // flags for parsing regexp_str_ bool error_; // error during constructor?