[all-commits] [llvm/llvm-project] 1067f2: [sancov] Don't instrument calls to bitcast funcs: ...

Ahmed Bougacha via All-commits all-commits at lists.llvm.org
Mon Mar 7 12:44:23 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1067f2177aa69dca0b9ffef57f5017c28cf9aed3
      https://github.com/llvm/llvm-project/commit/1067f2177aa69dca0b9ffef57f5017c28cf9aed3
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
    M llvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard.ll

  Log Message:
  -----------
  [sancov] Don't instrument calls to bitcast funcs: they're not indirect.

Currently, when instrumenting indirect calls, this uses
CallBase::getCalledFunction to determine whether a given callsite is
eligible.

However, that returns null if:
  this is an indirect function invocation or the function signature
  does not match the call signature.

So, we end up instrumenting direct calls where the callee is a bitcast
ConstantExpr, even though we presumably don't need to.

Use isIndirectCall to ignore those funky direct calls.

Differential Revision: https://reviews.llvm.org/D119594




More information about the All-commits mailing list