[compiler-rt] r365982 - [TSan] Tiny cleanup of UnmangleLongJmpSp for Linux/x86_64
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 17:55:06 PDT 2019
Author: yln
Date: Fri Jul 12 17:55:06 2019
New Revision: 365982
URL: http://llvm.org/viewvc/llvm-project?rev=365982&view=rev
Log:
[TSan] Tiny cleanup of UnmangleLongJmpSp for Linux/x86_64
NFC.
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=365982&r1=365981&r2=365982&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Fri Jul 12 17:55:06 2019
@@ -373,9 +373,7 @@ int ExtractRecvmsgFDs(void *msgp, int *f
// Reverse operation of libc stack pointer mangling
static uptr UnmangleLongJmpSp(uptr mangled_sp) {
#if defined(__x86_64__)
-# if SANITIZER_FREEBSD || SANITIZER_NETBSD
- return mangled_sp;
-# else // Linux
+# if SANITIZER_LINUX
// Reverse of:
// xor %fs:0x30, %rsi
// rol $0x11, %rsi
@@ -385,6 +383,8 @@ static uptr UnmangleLongJmpSp(uptr mangl
: "=r" (sp)
: "0" (mangled_sp));
return sp;
+# else
+ return mangled_sp;
# endif
#elif defined(__aarch64__)
# if SANITIZER_LINUX
@@ -394,11 +394,11 @@ static uptr UnmangleLongJmpSp(uptr mangl
# endif
#elif defined(__powerpc64__)
// Reverse of:
- // ld r4, -28696(r13)
- // xor r4, r3, r4
- uptr xor_guard;
- asm("ld %0, -28696(%%r13) \n" : "=r" (xor_guard));
- return mangled_sp ^ xor_guard;
+ // ld r4, -28696(r13)
+ // xor r4, r3, r4
+ uptr xor_key;
+ asm("ld %0, -28696(%%r13)" : "=r" (xor_key));
+ return mangled_sp ^ xor_key;
#elif defined(__mips__)
return mangled_sp;
#else
More information about the llvm-commits
mailing list