Skip to content

Commit b3980b5

Browse files
author
Julian Lettner
committed
[Sanitizer] Strip PAC from PC in StackTrace::GetNextInstructionPc()
In TSan, we use the a function reference (`__tsan_stack_initialization`) in a call to `StackTrace::GetNextInstructionPc(uptr pc)`. We sign function pointers, so we need to strip the signature from this function pointer. Caused by: https://reviews.llvm.org/D111147 Radar-Id: rdar://problem/83940546
1 parent 58901a5 commit b3980b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ uptr StackTrace::GetNextInstructionPc(uptr pc) {
2424
return pc + 8;
2525
#elif defined(__powerpc__) || defined(__arm__) || defined(__aarch64__) || \
2626
defined(__hexagon__)
27-
return pc + 4;
27+
return STRIP_PAC_PC((void *)pc) + 4;
2828
#elif SANITIZER_RISCV64
2929
// Current check order is 4 -> 2 -> 6 -> 8
3030
u8 InsnByte = *(u8 *)(pc);

0 commit comments

Comments
 (0)