[all-commits] [llvm/llvm-project] c5a6ad: [Sanitizer][RISCV] Fix internal_clone

Luís Marques via All-commits all-commits at lists.llvm.org
Mon Mar 8 14:30:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c5a6ad86b066a6f159b687d181d947cb43aab70b
      https://github.com/llvm/llvm-project/commit/c5a6ad86b066a6f159b687d181d947cb43aab70b
  Author: Luís Marques <luismarques at lowrisc.org>
  Date:   2021-03-08 (Mon, 08 Mar 2021)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

  Log Message:
  -----------
  [Sanitizer][RISCV] Fix internal_clone

A RISC-V implementation of `internal_clone` was introduced in D87573, as
part of the RISC-V ASan patch set by @EccoTheDolphin. That function was
never used/tested until I ported LSan for RISC-V, as part of D92403. That
port revealed problems in the original implementation, so I provided a fix
in D92403. Unfortunately, my choice of replacing the assembly with regular
C++ code wasn't correct. The clone syscall arguments specify a separate
stack, so non-inlined calls, spills, etc. aren't going to work. This wasn't
a problem in practice for optimized builds of Compiler-RT, but it breaks
for debug builds. This patch fixes the original problem while keeping the
assembly.

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




More information about the All-commits mailing list