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
1.7 KiB
1.7 KiB