[compiler-rt] 6b025da - [Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp
Luís Marques via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 17 08:58:10 PDT 2021
Author: Luís Marques
Date: 2021-03-17T15:57:54Z
New Revision: 6b025da443a4ad40b7c05317db05d50af9f3d49a
URL: https://github.com/llvm/llvm-project/commit/6b025da443a4ad40b7c05317db05d50af9f3d49a
DIFF: https://github.com/llvm/llvm-project/commit/6b025da443a4ad40b7c05317db05d50af9f3d49a.diff
LOG: [Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp
An implementation of `__sanitizer::BufferedStackTrace::UnwindImpl` is
provided per sanitizer, but there isn't one for sanitizer-common. In
non-optimized builds of the sanitizer-common tests that becomes a problem:
the test `sanitizer_stacktrace_test.cpp` won't have a reference to that
method optimized away, causing linking errors. This patch provides a dummy
implementation, which fixes those builds.
Differential Revision: https://reviews.llvm.org/D96956
Added:
Modified:
compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
index af19da0c5b6c..58f92fcf9eea 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
@@ -175,4 +175,11 @@ TEST(SlowUnwindTest, ShortStackTrace) {
EXPECT_EQ(bp, stack.top_frame_bp);
}
+// Dummy implementation. This should never be called, but is required to link
+// non-optimized builds of this test.
+void BufferedStackTrace::UnwindImpl(uptr pc, uptr bp, void *context,
+ bool request_fast, u32 max_depth) {
+ UNIMPLEMENTED();
+}
+
} // namespace __sanitizer
More information about the llvm-commits
mailing list