Commit 22b8fe3b authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Fix alloc/dealloc size mismatch

On newer compilers the {operator delete} with explicit {size_t}
argument would be instantiated for {CompilationState} and used in the
destructor of {std::unique_ptr<CompilationState>}. The {size_t}
argument is wrong though, since the pointer actually points to a
{CompilationStateImpl} object.
Hence avoid this operator from being created by explicitly providing an
{operator delete}.

R=ulan@chromium.org

Change-Id: I54fef07179b3106f3154ddd43df040fe8e3cdde8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631426Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61859}
parent e253d974
......@@ -122,6 +122,10 @@ class CompilationState {
V8_EXPORT_PRIVATE bool baseline_compilation_finished() const;
V8_EXPORT_PRIVATE bool top_tier_compilation_finished() const;
// Override {operator delete} to avoid implicit instantiation of {operator
// delete} with {size_t} argument. The {size_t} argument would be incorrect.
void operator delete(void* ptr) { ::operator delete(ptr); }
private:
// NativeModule is allowed to call the static {New} method.
friend class NativeModule;
......
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