ladybird/Libraries/LibWasm/Tests
sideshowbarker 59eb221d7c LibWasm: Fix “return” leaking intermediate value-stack entries to caller
Problem: Loading WebAssembly modules that use “return” mid-function can
corrupt the heap and crash the browser.

Cause: HANDLE_INSTRUCTION(return_) shrank the label stack but left any
working values pushed before the “return” instruction on the shared
value stack. Those residuals leaked into the caller’s frame and
accumulated across calls — until they overflowed the value stack’s
inline storage and corrupted adjacent allocator metadata.

Fix: After shrinking the label stack down to the function-level label,
also remove value-stack entries between that label’s recorded
stack_height and the top .arity() result values — mirroring the cleanup
that branch_to_label<true> already performs for br/br_if.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/9614
2026-05-25 09:00:44 +02:00
..
CI CI: Create wasm artifact and use it in the js-benchmarks workflow 2025-08-14 10:02:35 +02:00
Executor LibWasm: Fix “return” leaking intermediate value-stack entries to caller 2026-05-25 09:00:44 +02:00
Fixtures/Modules LibWasm: Fix “return” leaking intermediate value-stack entries to caller 2026-05-25 09:00:44 +02:00
Parser Meta: Increase the line length enforced by prettier to 120 2025-10-31 19:55:50 -04:00