mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 02:55:15 +00:00
![]() 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! |
||
---|---|---|
.. | ||
apps | ||
color-palettes | ||
color-schemes | ||
cursor-themes | ||
devel/templates | ||
emoji | ||
fonts | ||
graphics | ||
html/misc | ||
icons | ||
js/Spreadsheet | ||
keymaps | ||
ladybird | ||
themes | ||
wallpapers | ||
fortunes.json | ||
words.txt |