Skip to content
Snippets Groups Projects
Commit f98fc08b authored by Kostya Serebryany's avatar Kostya Serebryany
Browse files

[asan] GET_CALLER_PC macro for Win. Patch by timurrrr@google.com

llvm-svn: 149994
parent d6125563
No related branches found
No related tags found
No related merge requests found
......@@ -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 \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment