ladybird/Libraries/LibWasm/AbstractMachine
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
..
AbstractMachine.cpp LibWasm+LibWeb: Properly track module lifetime with function refs 2026-05-10 16:41:42 +02:00
AbstractMachine.h LibWasm+LibWeb: Properly track module lifetime with function refs 2026-05-10 16:41:42 +02:00
BytecodeInterpreter.cpp LibWasm: Fix “return” leaking intermediate value-stack entries to caller 2026-05-25 09:00:44 +02:00
BytecodeInterpreter.h LibWasm+Meta: Add Cranelift AOT compilation backend 2026-05-10 16:41:42 +02:00
Configuration.cpp LibWasm: Prepare for VM and direct function calls 2026-05-10 16:41:42 +02:00
Configuration.h LibWasm: Prepare for VM and direct function calls 2026-05-10 16:41:42 +02:00
Interpreter.h LibWasm: Make traps hold on to externally-managed data 2025-04-22 08:43:46 -06:00
Operators.h LibWasm: Implement (n)madd/vetor dot arguments the right way 2025-12-12 19:12:53 +01:00
Validator.cpp LibWasm: Store try_table catches out of line 2026-05-14 12:19:38 +02:00
Validator.h LibWasm: Implement call_ref and return_call_ref instructions 2026-03-07 16:05:20 +01:00