History log of /llvm-project/llvm/unittests/ExecutionEngine/Orc/MemoryFlagsTest.cpp (Results 1 – 1 of 1)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# b15aa7f8 22-Jul-2024 Lang Hames <lhames@gmail.com>

[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 result

[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

show more ...