[all-commits] [llvm/llvm-project] c9dae4: [memprof] Add access checks to PortableMemInfoBloc...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sun Apr 28 12:49:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9dae43438897590a21edbc89003bd6704659c7c
      https://github.com/llvm/llvm-project/commit/c9dae43438897590a21edbc89003bd6704659c7c
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-04-28 (Sun, 28 Apr 2024)

  Changed paths:
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/unittests/ProfileData/InstrProfTest.cpp
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  [memprof] Add access checks to PortableMemInfoBlock::get* (#90121)

commit 4c8ec8f8bc3fb4dda4fd36c3b2ad745bd3451970
  Author: Kazu Hirata <kazu at google.com>
  Date:   Wed Apr 24 16:25:35 2024 -0700

introduced the idea of serializing/deserializing a subset of the
fields in PortableMemInfoBlock.  While it reduces the size of the
indexed MemProf profile file, we now could inadvertently access
unavailable fields and go without noticing.

To protect ourselves from the risk, this patch adds access checks to
PortableMemInfoBlock::get* methods by embedding a bit set representing
available fields into PortableMemInfoBlock.



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