#
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 ...
|