Files
clang-p2996/llvm/unittests/ExecutionEngine/Orc/MemoryFlagsTest.cpp
Lang Hames b15aa7f88c [ORC] Add unit test for MemoryFlags APIs, don't dereference end() iterator.
In AllocGroupSmallMap::find(AllocGroup) we were calling lower_bound(...) and
then unconditionally dereferencing the resulting iterator, however
lower_bound(...) may return end() if the value being searched for is higher
than any value present in the map. This patch adds a check for end() before
the dereference to guard against dereference of end().

This commit also adds some basic unit tests for MemProt and AllocGroupSmallMap.

rdar://129662981
2024-07-22 17:16:32 +10:00

1.7 KiB