From 846cdbdbf965fc50478bcc4c6436e3dc6a489f3f Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Thu, 14 Oct 2021 19:01:18 -0400 Subject: Initial commit. --- .../files/chromium-96-EnumTable-crash.patch | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 www-client/chromium/files/chromium-96-EnumTable-crash.patch (limited to 'www-client/chromium/files/chromium-96-EnumTable-crash.patch') diff --git a/www-client/chromium/files/chromium-96-EnumTable-crash.patch b/www-client/chromium/files/chromium-96-EnumTable-crash.patch new file mode 100644 index 0000000..9736739 --- /dev/null +++ b/www-client/chromium/files/chromium-96-EnumTable-crash.patch @@ -0,0 +1,76 @@ +diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h +index aad9e08..2f3fcad 100644 +--- a/components/cast_channel/enum_table.h ++++ b/components/cast_channel/enum_table.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/check_op.h" + #include "base/macros.h" +@@ -188,7 +189,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -254,7 +254,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -313,15 +312,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast(data_.begin()), +- data_.size(), static_cast(value)); ++ &data_[0], data_.size(), static_cast(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -349,8 +347,7 @@ class EnumTable { + // enum value directly. + absl::optional GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast(entry->value) : absl::optional(); + } + +@@ -365,7 +362,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list data_; ++ const std::vector data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list data, bool is_sorted) +@@ -377,8 +374,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) -- cgit v1.2.3