Commit ac357002 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[msan] Remove alloc-dealloc mismatch

A std::unique_ptr of array type uses the "delete[]" operator to delete
the memory, hence we should use "new[]" to allocate it.
I sometimes get this reported locally, even though I have
"alloc_dealloc_mismatch=0" in ASAN_OPTIONS. So why not just fix it.

R=marja@chromium.org

Bug: v8:7754
Change-Id: I026287a0e0ee4b9560c4fc7333267e738392b13f
Reviewed-on: https://chromium-review.googlesource.com/1057230Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53154}
parent 7927d646
......@@ -276,7 +276,9 @@ std::unique_ptr<char[]> FunctionLiteral::GetDebugName() const {
AllowHandleDereference allow_deref;
return inferred_name_->ToCString();
} else {
return std::unique_ptr<char[]>(new char{'\0'});
char* empty_str = new char[1];
empty_str[0] = 0;
return std::unique_ptr<char[]>(empty_str);
}
// TODO(rmcilroy): Deal with two-character strings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment