Commit 1a8b7758 by Tim Van Patten Committed by Commit Bot

Fix assignment of CacheOpResult::EnumCount

The special enum value 'EnumCount' is used by EnumSize() to determine how large to make the PackedEnumMap::mPrivateData array. However, that enum entry was being assigned an incorrect value, leading to the array being constructed too small and causing a crash in PackedEnumMap's std::initializer_list constructor when it went beyond the size of the array to assign each of the necessary values. The fix is to remove the assignment of CacheOpResult::EnumCount and let it indicate the real number of entries in the enum. Bug: angleproject:4393 Test: end2end Change-Id: If9635c61e72aadc6527d416f83be18add8b24572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2050026Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent b40d48a6
...@@ -28,7 +28,7 @@ enum class CacheOpResult ...@@ -28,7 +28,7 @@ enum class CacheOpResult
GetMemoryTooSmall, GetMemoryTooSmall,
GetSuccess, GetSuccess,
ValueNotSet, ValueNotSet,
EnumCount = ValueNotSet, EnumCount
}; };
angle::PackedEnumMap<CacheOpResult, std::string> kCacheOpToString = { angle::PackedEnumMap<CacheOpResult, std::string> kCacheOpToString = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment