[all-commits] [llvm/llvm-project] b15aa7: [ORC] Add unit test for MemoryFlags APIs, don't de...

Lang Hames via All-commits all-commits at lists.llvm.org
Mon Jul 22 00:16:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b15aa7f88c21d126bac4cf77eb05c522e0f1870d
      https://github.com/llvm/llvm-project/commit/b15aa7f88c21d126bac4cf77eb05c522e0f1870d
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-07-22 (Mon, 22 Jul 2024)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
    M llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
    A llvm/unittests/ExecutionEngine/Orc/MemoryFlagsTest.cpp

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list