summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_stacktrace.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-29 23:22:41 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-29 23:22:41 +0000
commitd137df1415f805e26caf3a245423733423acd69d (patch)
tree67b8fd9b43409f019d472b738801d1ff15a5e944 /lib/sanitizer_common/sanitizer_stacktrace.h
parent56af5a0071456b9bbbb56808baaed5946aa907b9 (diff)
[UBSan] Get pc/bp for stack unwinding as early as possible.
This will ensure that stack frames in error reports will not contain internal UBSan failures, and frame #0 will be the actual place in the program where the error happens. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_stacktrace.h')
-rw-r--r--lib/sanitizer_common/sanitizer_stacktrace.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_stacktrace.h b/lib/sanitizer_common/sanitizer_stacktrace.h
index fcaa777cc..75ab3a06d 100644
--- a/lib/sanitizer_common/sanitizer_stacktrace.h
+++ b/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -88,6 +88,10 @@ struct StackTrace {
uptr local_stack; \
uptr sp = (uptr)&local_stack
+#define GET_CALLER_PC_BP \
+ uptr bp = GET_CURRENT_FRAME(); \
+ uptr pc = GET_CALLER_PC();
+
// Use this macro if you want to print stack trace with the current
// function in the top frame.
#define GET_CURRENT_PC_BP_SP \