Skip to content

Commit 3dafc14

Browse files
addaleaxtargos
authored andcommitted
tools: fix mkcodecache when run with ASAN
Fixes: #32835 PR-URL: #32850 Backport-PR-URL: #33128 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent 1c010b4 commit 3dafc14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/code_cache/mkcodecache.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ int main(int argc, char* argv[]) {
4949

5050
// Create a new Isolate and make it the current one.
5151
Isolate::CreateParams create_params;
52-
create_params.array_buffer_allocator =
53-
ArrayBuffer::Allocator::NewDefaultAllocator();
52+
std::unique_ptr<ArrayBuffer::Allocator> array_buffer_allocator {
53+
ArrayBuffer::Allocator::NewDefaultAllocator() };
54+
create_params.array_buffer_allocator = array_buffer_allocator.get();
5455
Isolate* isolate = Isolate::New(create_params);
5556
{
5657
Isolate::Scope isolate_scope(isolate);
@@ -65,6 +66,7 @@ int main(int argc, char* argv[]) {
6566
out << cache;
6667
out.close();
6768
}
69+
isolate->Dispose();
6870

6971
v8::V8::ShutdownPlatform();
7072
return 0;

0 commit comments

Comments
 (0)