asan: Bypass the “nearby PC” check

Under asan, there are many more instructions than without. The “nearby
PC” check is much less useful, and would likely fail.

TEST=crashpad_client_test CaptureContext.CaptureContext
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1298943003 .
This commit is contained in:
Mark Mentovai 2015-08-19 18:50:15 -04:00
parent b1d7833600
commit 3b6e5613cb

View File

@ -102,10 +102,14 @@ void TestCaptureContext() {
// The program counter reference value is this functions 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