Skip to content

Commit

Permalink
Correct mangled_sp on NetBSD/amd64 in TSan
Browse files Browse the repository at this point in the history
The proper index is 6, not 2.

Patch extracted from https://reviews.llvm.org/D40337

Reviewed and accepted by <dvyukov>.

Sponsored by <The NetBSD Foundation>

llvm-svn: 319163
  • Loading branch information
krytarowski committed Nov 28, 2017
1 parent bc8cc86 commit b789ab3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,17 @@ static void SetJmp(ThreadState *thr, uptr sp, uptr mangled_sp) {
static void LongJmp(ThreadState *thr, uptr *env) {
#ifdef __powerpc__
uptr mangled_sp = env[0];
#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
#elif SANITIZER_FREEBSD
uptr mangled_sp = env[2];
#elif SANITIZER_NETBSD
uptr mangled_sp = env[6];
#elif SANITIZER_MAC
# ifdef __aarch64__
uptr mangled_sp = env[13];
# else
uptr mangled_sp = env[2];
# endif
#elif defined(SANITIZER_LINUX)
#elif SANITIZER_LINUX
# ifdef __aarch64__
uptr mangled_sp = env[13];
# elif defined(__mips64)
Expand Down

0 comments on commit b789ab3

Please sign in to comment.