[PATCH] D120362: [sanitizer][sancov] Refactor GetNextInstructionPc/GetPreviousInstructionPc

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 15:09:07 PST 2022


MaskRay created this revision.
MaskRay added reviewers: Sanitizers, morehouse, vitalybuka.
Herald added subscribers: luke957, pengfei, s.egerton, atanasyan, simoncook, fedor.sergeev, arichardson, sdardis, jyknight.
MaskRay requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added projects: Sanitizers, LLVM.

x86 uses offset 1 while most RISC architectures use offset 4.
Check x86 first to prevent changes for new RISC architectures.

For sancov, `getPreviousInstructionPc` does not use the `PC - 8` code path for
Sparc. Triple.h does not have isSparc yet and I hope someone can investigate
why Mips/Sparc use the weird -8.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120362

Files:
  compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
  llvm/tools/sancov/sancov.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120362.410652.patch
Type: text/x-patch
Size: 3615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/b5289e72/attachment-0001.bin>


More information about the llvm-commits mailing list