diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2020-07-16 10:38:48 +0200 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2020-07-16 10:38:48 +0200 |
commit | 6805c1c6a6254b6df6799d820c0d08a3dbfbec96 (patch) | |
tree | 5e69f0b7a5b893ef9c946ff1dda54e8c6fdccad0 /libsanitizer | |
parent | fe8185b50914a412f8e3d63e2baa19d0a4f38140 (diff) | |
download | gcc-6805c1c6a6254b6df6799d820c0d08a3dbfbec96.zip gcc-6805c1c6a6254b6df6799d820c0d08a3dbfbec96.tar.gz gcc-6805c1c6a6254b6df6799d820c0d08a3dbfbec96.tar.bz2 |
libsanitizer: Fix GetPcSpBp determination of SP on 32-bit Solaris/x86
The latest Solaris 11.4/x86 update uncovered a libsanitizer bug that
caused one test to FAIL for 32-bit:
+FAIL: c-c++-common/asan/null-deref-1.c -O0 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O1 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -flto-partition=none
output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O3 -g output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -Os output pattern test
I've identified the problem and the fix has just landed in upstream
llvm-project:
https://reviews.llvm.org/D83664
Tested on i386-pc-solaris2.11 and x86_64-pc-linux.gnu.
libsanitizer:
* sanitizer_common/sanitizer_linux.cpp: Cherry-pick llvm-project
revision f0e9b76c3500496f8f3ea7abe6f4bf801e3b41e7.
Diffstat (limited to 'libsanitizer')
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_linux.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cpp b/libsanitizer/sanitizer_common/sanitizer_linux.cpp index 2168301..11c03e2 100644 --- a/libsanitizer/sanitizer_common/sanitizer_linux.cpp +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cpp @@ -2043,13 +2043,13 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { # ifndef REG_EBP # define REG_EBP 6 // REG_FP # endif -# ifndef REG_ESP -# define REG_ESP 17 // REG_SP +# ifndef REG_UESP +# define REG_UESP 17 // REG_SP # endif # endif *pc = ucontext->uc_mcontext.gregs[REG_EIP]; *bp = ucontext->uc_mcontext.gregs[REG_EBP]; - *sp = ucontext->uc_mcontext.gregs[REG_ESP]; + *sp = ucontext->uc_mcontext.gregs[REG_UESP]; # endif #elif defined(__powerpc__) || defined(__powerpc64__) ucontext_t *ucontext = (ucontext_t*)context; |