diff options
author | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2014-06-15 13:56:28 +0000 |
---|---|---|
committer | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2014-06-15 13:56:28 +0000 |
commit | aa515f00bb00a172938ac1457e44ddf7f9f94492 (patch) | |
tree | 401ecd19d05804c904d2e1d557eb64494a0906c5 /lib/asan/asan_linux.cc | |
parent | 67eb177e0857e7d9956937dd8e3134e72e5c36b7 (diff) |
Fix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r-- | lib/asan/asan_linux.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index b3c45ee86..fdd009c96 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -19,6 +19,7 @@ #include "asan_internal.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_flags.h" +#include "sanitizer_common/sanitizer_freebsd.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_procmaps.h" @@ -46,15 +47,11 @@ extern "C" void* _DYNAMIC; #include <link.h> #endif -// x86_64 FreeBSD 9.2 and older define 64-bit register names in both 64-bit -// and 32-bit modes. -#if SANITIZER_FREEBSD -#include <sys/param.h> -# if __FreeBSD_version <= 902001 // v9.2 -# define mc_eip mc_rip -# define mc_ebp mc_rbp -# define mc_esp mc_rsp -# endif +// x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in +// 32-bit mode. +#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \ + __FreeBSD_version <= 902001 // v9.2 +#define ucontext_t xucontext_t #endif typedef enum { |