[all-commits] [llvm/llvm-project] 930635: [Clang] Emit KCFI type hashes for member functions

Sami Tolvanen via All-commits all-commits at lists.llvm.org
Fri Jul 7 09:51:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 930635271f810316f48bd1aa78935acf36a08f8f
      https://github.com/llvm/llvm-project/commit/930635271f810316f48bd1aa78935acf36a08f8f
  Author: Sami Tolvanen <samitolvanen at google.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGen/kcfi.c

  Log Message:
  -----------
  [Clang] Emit KCFI type hashes for member functions

With `-fsanitize=kcfi`, Clang currently won't emit type hashes for
C++ member functions, which leads to check failures if they are
indirectly called. As there's no reason to exclude member functions
in CodeGenModule::setKCFIType, emit type hashes also for them to fix
member function pointer calls with KCFI, and add a test to confirm
that types are emitted correctly.




More information about the All-commits mailing list