mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
8892c25520
Previously, using `wasm-decompile` to decompile the Wasm bytecode on the `wasm.html` example page gave this output: ``` export function fib(a:int):int { if (a < 2) { return 1 } return fib(a - 2) + fib(a - 1); } ``` With this change the bytecode now decompiles to: ``` export function fib(a:int):int { if (a <= 0) { return 0 } if (a == 1) { return 1 } return fib(a - 2) + fib(a - 1); } ``` This means that the example page now prints the correct answer of 55 to the console for `fib(10)`. Previously, `fib(10)` returned 89. I also used `wasm-opt -Oz`, which removed an unnecessary `return` instruction, saving 1 byte! |
||
---|---|---|
.. | ||
etc | ||
home/anon | ||
res | ||
root | ||
usr/share | ||
www |