Skip to content

Commit 6b025da

Browse files
committed
[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
1 parent 402f2ca commit 6b025da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,11 @@ TEST(SlowUnwindTest, ShortStackTrace) {
175175
EXPECT_EQ(bp, stack.top_frame_bp);
176176
}
177177

178+
// Dummy implementation. This should never be called, but is required to link
179+
// non-optimized builds of this test.
180+
void BufferedStackTrace::UnwindImpl(uptr pc, uptr bp, void *context,
181+
bool request_fast, u32 max_depth) {
182+
UNIMPLEMENTED();
183+
}
184+
178185
} // namespace __sanitizer

0 commit comments

Comments
 (0)