Commit 14ac92e0 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm][liftoff][eh] Fix label allocation leak

The TryInfo is allocated in the zone and its destructor is never
called, so the catch_label allocated on the heap is never freed.
Add the Label as a non-pointer field of the TryInfo instead.

R=clemensb@chromium.org

Bug: chromium:1184925
Change-Id: Ic0246d15a6474c56a78f167eba51caca9ec5b453
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2739645
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73225}
parent 1b67ab4d
...@@ -373,7 +373,7 @@ class LiftoffCompiler { ...@@ -373,7 +373,7 @@ class LiftoffCompiler {
struct TryInfo { struct TryInfo {
TryInfo() = default; TryInfo() = default;
LiftoffAssembler::CacheState catch_state; LiftoffAssembler::CacheState catch_state;
MovableLabel catch_label; Label catch_label;
bool catch_reached = false; bool catch_reached = false;
int32_t previous_catch = -1; int32_t previous_catch = -1;
}; };
...@@ -1084,7 +1084,7 @@ class LiftoffCompiler { ...@@ -1084,7 +1084,7 @@ class LiftoffCompiler {
return; return;
} }
__ bind(block->try_info->catch_label.get()); __ bind(&block->try_info->catch_label);
__ cache_state()->Steal(block->try_info->catch_state); __ cache_state()->Steal(block->try_info->catch_state);
} }
...@@ -3698,7 +3698,7 @@ class LiftoffCompiler { ...@@ -3698,7 +3698,7 @@ class LiftoffCompiler {
current_try->try_info->catch_reached = true; current_try->try_info->catch_reached = true;
} }
__ MergeStackWith(current_try->try_info->catch_state, 0); __ MergeStackWith(current_try->try_info->catch_state, 0);
__ emit_jump(current_try->try_info->catch_label.get()); __ emit_jump(&current_try->try_info->catch_label);
__ bind(&skip_handler); __ bind(&skip_handler);
} }
......
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