Closed illarionov closed 6 months ago
Hey @illarionov, Thank you for looking into this!
These are actually on my list of things to do as all of the recursive executors ended up causing issues, mostly because they are not tailrec but to be honest they're really inefficient. For example memory_init is just about copying bytes from one byte array to another and that can be optimised down to a single copy instruction.
As I know this is causing you an issue I'll add to the top of the list, expect a release in the next couple of days 😃
@illarionov
I've just released a new version, do let me know if it addresses your issues and feel free to close the issue if so.
@CharlieTap everything works now, thanks for the quick fix!
I attempted to use this library to execute WebAssembly code but encountered StackOverflowError exception in MemoryInitExecutorImpl and in TableInitExecutorImpl functions. Here are the stack traces:
In version 0.2.2 of the library, I also faced StackOverflowError in MemoryCopyExecutorImpl and MemoryFillExecutorImpl. However, I see that these were fixed in version 0.6.0, and I no longer see those errors.
As a workaround, I made a MemoryInitExecutorImpl and TableInitExecutorImpl tailrec: diff. This fixes the error, but I think there should be a more elegant solution.
This is a repository where I'm experimenting with running WebAssembly code: https://github.com/illarionov/wasm-sqlite-open-helper/tree/chasmDevel. If you require it, I can later attempt to create a smaller reproducible example.