xtuc / webassemblyjs

Toolchain for WebAssembly
https://webassembly.js.org
MIT License
779 stars 90 forks source link

Change utf8 decoder to be iterative and not overflow the call stack #1136

Closed deongroenewald closed 8 months ago

deongroenewald commented 1 year ago

I was getting errors similar to #918 and #922 (converting a rust lib to WASM) and noted that the stack was overflowing due to the recursion in the _decode() function of the utf8 package.

Changing the implementation to be iterative resolved these errors for me.

xtuc commented 1 year ago

Nice, thanks for the change. I'll have a look.

deongroenewald commented 8 months ago

Closing since #1140 has been merged.