forked from OSchip/llvm-project
[asan] GET_CALLER_PC macro for Win. Patch by timurrrr@google.com
llvm-svn: 149994
This commit is contained in:
parent
d61255638f
commit
f98fc08bc7
|
@ -212,12 +212,16 @@ const size_t kPageSizeBits = 12;
|
|||
const size_t kPageSize = 1UL << kPageSizeBits;
|
||||
|
||||
#ifndef _WIN32
|
||||
#define GET_CALLER_PC() (uintptr_t)__builtin_return_address(0)
|
||||
#define GET_CURRENT_FRAME() (uintptr_t)__builtin_frame_address(0)
|
||||
# define GET_CALLER_PC() (uintptr_t)__builtin_return_address(0)
|
||||
# define GET_CURRENT_FRAME() (uintptr_t)__builtin_frame_address(0)
|
||||
#else
|
||||
// TODO(timurrrr): implement.
|
||||
#define GET_CALLER_PC() (uintptr_t)0
|
||||
#define GET_CURRENT_FRAME() (uintptr_t)0
|
||||
extern "C" void* _ReturnAddress(void);
|
||||
# pragma intrinsic(_ReturnAddress)
|
||||
# define GET_CALLER_PC() (uintptr_t)_ReturnAddress()
|
||||
// CaptureStackBackTrace doesn't need to know BP on Windows.
|
||||
// FIXME: This macro is still used when printing error reports though it's not
|
||||
// clear if the BP value is needed in the ASan reports on Windows.
|
||||
# define GET_CURRENT_FRAME() (uintptr_t)0xDEADBEEF
|
||||
#endif
|
||||
|
||||
#define GET_BP_PC_SP \
|
||||
|
|
Loading…
Reference in New Issue