Commit d19c08c9 by Courtney Goeltzenleuchter Committed by Commit Bot

Fix ASAN issue with FastIntegerMap.BasicUsage

ASAN bot caught bug in FastIntegerMap.BasicUsage test. The end() iterator points past the end of the list, accessing end()->first is invalid. rbegin() points at the last element of the list which is what this test intended. Bug: b/166255370 Change-Id: I06e098143d3de9658088cda6f10761d41b17a520 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2375305Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
parent 33f8e4d4
......@@ -334,7 +334,7 @@ TEST(FastIntegerMap, BasicUsage)
std::string str;
testMap.insert(entries.begin()->first, entries.begin()->second);
EXPECT_TRUE(testMap.contains(entries.begin()->first));
EXPECT_FALSE(testMap.contains(entries.end()->first));
EXPECT_FALSE(testMap.contains(entries.rbegin()->first));
EXPECT_FALSE(testMap.empty());
EXPECT_EQ(testMap.size(), 1u);
EXPECT_TRUE(testMap.get(entries.begin()->first, &str));
......
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