forked from OSchip/llvm-project
Print a more useful BP value from MSVC-built ASan runtimes
MSVC doesn't have an exact equivalent for __builtin_frame_address, but _AddressOfReturnAddress() + sizeof(void*) should be equivalent for all frames build with -fno-omit-frame-pointer. llvm-svn: 277826
This commit is contained in:
parent
5bf494e73d
commit
2a06f48bb5
|
@ -296,12 +296,12 @@ inline void Trap() {
|
|||
}
|
||||
#else
|
||||
extern "C" void* _ReturnAddress(void);
|
||||
extern "C" void* _AddressOfReturnAddress(void);
|
||||
# pragma intrinsic(_ReturnAddress)
|
||||
# pragma intrinsic(_AddressOfReturnAddress)
|
||||
# define GET_CALLER_PC() (uptr)_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() (uptr)0xDEADBEEF
|
||||
# define GET_CURRENT_FRAME() (((uptr)_AddressOfReturnAddress()) + sizeof(uptr))
|
||||
|
||||
extern "C" void __ud2(void);
|
||||
# pragma intrinsic(__ud2)
|
||||
|
|
Loading…
Reference in New Issue