From 9cc253cc46e1406a7e470903197e8dd0084a8135 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 14 Apr 2020 19:01:29 +0200 Subject: [PATCH 1/2] tools: fix mkcodecache when run with ASAN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/32835 PR-URL: https://github.com/nodejs/node/pull/32850 Reviewed-By: Matheus Marchini Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Juan José Arboleda Reviewed-By: Jiawen Geng --- tools/code_cache/mkcodecache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/code_cache/mkcodecache.cc b/tools/code_cache/mkcodecache.cc index 34af7bc61ba374..23df0f69317b8b 100644 --- a/tools/code_cache/mkcodecache.cc +++ b/tools/code_cache/mkcodecache.cc @@ -49,8 +49,8 @@ int main(int argc, char* argv[]) { // Create a new Isolate and make it the current one. Isolate::CreateParams create_params; - create_params.array_buffer_allocator = - ArrayBuffer::Allocator::NewDefaultAllocator(); + create_params.array_buffer_allocator_shared.reset( + ArrayBuffer::Allocator::NewDefaultAllocator()); Isolate* isolate = Isolate::New(create_params); { Isolate::Scope isolate_scope(isolate); @@ -65,6 +65,7 @@ int main(int argc, char* argv[]) { out << cache; out.close(); } + isolate->Dispose(); v8::V8::ShutdownPlatform(); return 0; From 7a21f033677c96353f80c68aad9efc53d1d398c6 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 28 Apr 2020 17:28:56 +0200 Subject: [PATCH 2/2] fixup! tools: fix mkcodecache when run with ASAN --- tools/code_cache/mkcodecache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/code_cache/mkcodecache.cc b/tools/code_cache/mkcodecache.cc index 23df0f69317b8b..fabb6a1a5d2f4d 100644 --- a/tools/code_cache/mkcodecache.cc +++ b/tools/code_cache/mkcodecache.cc @@ -49,8 +49,9 @@ int main(int argc, char* argv[]) { // Create a new Isolate and make it the current one. Isolate::CreateParams create_params; - create_params.array_buffer_allocator_shared.reset( - ArrayBuffer::Allocator::NewDefaultAllocator()); + std::unique_ptr array_buffer_allocator { + ArrayBuffer::Allocator::NewDefaultAllocator() }; + create_params.array_buffer_allocator = array_buffer_allocator.get(); Isolate* isolate = Isolate::New(create_params); { Isolate::Scope isolate_scope(isolate);