Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: client/capture_context_mac_test.cc

Issue 1298943003: asan: Bypass the “nearby PC” check (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/capture_context_mac_test.cc
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 660776afe4c933b20d84dd2c4cc2c82a6dde667b..2e744cd387a655339f77ff045254460576f0cbb6 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -102,10 +102,14 @@ void TestCaptureContext() {
// The program counter reference value is this function’s address. The
// captured program counter should be slightly greater than or equal to the
// reference program counter.
+ uintptr_t pc = ProgramCounterFromContext(&context_1);
+#if !__has_feature(address_sanitizer)
+ // AddressSanitizer can cause enough code bloat that the “nearby” check would
+ // likely fail.
const uintptr_t kReferencePC =
reinterpret_cast<uintptr_t>(TestCaptureContext);
- uintptr_t pc = ProgramCounterFromContext(&context_1);
EXPECT_LT(pc - kReferencePC, 64u);
+#endif
// Declare sp and context_2 here because all local variables need to be
// declared before computing the stack pointer reference value, so that the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698