| Index: third_party/re2/patches/re2-msan.patch
|
| diff --git a/third_party/re2/patches/re2-msan.patch b/third_party/re2/patches/re2-msan.patch
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..08b7bde9d64197e43d3f2b27b5e5abdd2dc7d8e3
|
| --- /dev/null
|
| +++ b/third_party/re2/patches/re2-msan.patch
|
| @@ -0,0 +1,62 @@
|
| +diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_array.h
|
| +index 3e33f89..613417d 100644
|
| +--- a/third_party/re2/util/sparse_array.h
|
| ++++ b/third_party/re2/util/sparse_array.h
|
| +@@ -231,7 +231,14 @@ class SparseArray {
|
| +
|
| + template<typename Value>
|
| + SparseArray<Value>::SparseArray()
|
| +- : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(), valgrind_(RunningOnValgrind()) {}
|
| ++ : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(),
|
| ++#if defined(MEMORY_SANITIZER)
|
| ++ valgrind_(true)
|
| ++#else
|
| ++ valgrind_(RunningOnValgrind())
|
| ++#endif
|
| ++{
|
| ++}
|
| +
|
| + // IndexValue pairs: exposed in SparseArray::iterator.
|
| + template<typename Value>
|
| +@@ -418,7 +425,11 @@ void SparseArray<Value>::create_index(int i) {
|
| + template<typename Value> SparseArray<Value>::SparseArray(int max_size) {
|
| + max_size_ = max_size;
|
| + sparse_to_dense_ = new int[max_size];
|
| ++#if defined(MEMORY_SANITIZER)
|
| ++ valgrind_ = true;
|
| ++#else
|
| + valgrind_ = RunningOnValgrind();
|
| ++#endif
|
| + dense_.resize(max_size);
|
| + // Don't need to zero the new memory, but appease Valgrind.
|
| + if (valgrind_) {
|
| +diff --git a/third_party/re2/util/sparse_set.h b/third_party/re2/util/sparse_set.h
|
| +index 165dd09..f59ed0b 100644
|
| +--- a/third_party/re2/util/sparse_set.h
|
| ++++ b/third_party/re2/util/sparse_set.h
|
| +@@ -54,13 +54,24 @@ namespace re2 {
|
| + class SparseSet {
|
| + public:
|
| + SparseSet()
|
| +- : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL), valgrind_(RunningOnValgrind()) {}
|
| ++ : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL),
|
| ++#if defined(MEMORY_SANITIZER)
|
| ++ valgrind_(true)
|
| ++#else
|
| ++ valgrind_(RunningOnValgrind())
|
| ++#endif
|
| ++ {
|
| ++ }
|
| +
|
| + SparseSet(int max_size) {
|
| + max_size_ = max_size;
|
| + sparse_to_dense_ = new int[max_size];
|
| + dense_ = new int[max_size];
|
| ++#if defined(MEMORY_SANITIZER)
|
| ++ valgrind_ = true;
|
| ++#else
|
| + valgrind_ = RunningOnValgrind();
|
| ++#endif
|
| + // Don't need to zero the memory, but do so anyway
|
| + // to appease Valgrind.
|
| + if (valgrind_) {
|
|
|