diff --git a/snapshot/win/exception_snapshot_win_test.cc b/snapshot/win/exception_snapshot_win_test.cc index 2d4e9090..07a25a89 100644 --- a/snapshot/win/exception_snapshot_win_test.cc +++ b/snapshot/win/exception_snapshot_win_test.cc @@ -102,7 +102,12 @@ class CrashingDelegate : public ExceptionHandlerServer::Delegate { // Verify the exception happened at the expected location with a bit of // slop space to allow for reading the current PC before the exception // happens. See TestCrashingChild(). +#if !defined(NDEBUG) + // Debug build is likely not optimized and contains more instructions. + constexpr uint64_t kAllowedOffset = 200; +#else constexpr uint64_t kAllowedOffset = 100; +#endif EXPECT_GT(snapshot.Exception()->ExceptionAddress(), break_near_); EXPECT_LT(snapshot.Exception()->ExceptionAddress(), break_near_ + kAllowedOffset); @@ -215,7 +220,7 @@ class SimulateDelegate : public ExceptionHandlerServer::Delegate { constexpr uint64_t kAllowedOffset = 500; #elif !defined(NDEBUG) // Debug build is likely not optimized and contains more instructions. - constexpr uint64_t kAllowedOffset = 150; + constexpr uint64_t kAllowedOffset = 200; #else constexpr uint64_t kAllowedOffset = 100; #endif