From 98822430907b603d671f8ade5f20723a0f8ecc03 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 11 Jan 2017 05:53:10 -0800 Subject: Pass expose-gc flag to pdfium test programs. I also made the call to set the flags occur before the Initialize() call, as this appears to be the pattern elsewhere in our codebase. Review-Url: https://codereview.chromium.org/2627563003 --- testing/test_support.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/test_support.cpp b/testing/test_support.cpp index c4d915e900..a530b3ea4c 100644 --- a/testing/test_support.cpp +++ b/testing/test_support.cpp @@ -63,12 +63,12 @@ void InitializeV8Common(const char* exe_path, v8::Platform** platform) { *platform = v8::platform::CreateDefaultPlatform(); v8::V8::InitializePlatform(*platform); - v8::V8::Initialize(); // By enabling predictable mode, V8 won't post any background tasks. - const char predictable_flag[] = "--predictable"; - v8::V8::SetFlagsFromString(predictable_flag, - static_cast(strlen(predictable_flag))); + // By enabling GC, it makes it easier to chase use-after-free. + const char v8_flags[] = "--predictable --expose-gc"; + v8::V8::SetFlagsFromString(v8_flags, static_cast(strlen(v8_flags))); + v8::V8::Initialize(); } #endif // PDF_ENABLE_V8 -- cgit v1.2.3