New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm: slice copy bombing out #64
Comments
Yes, that looks like a bug. Thank you for the report! Currently investigating. However, note that you can't currently return a string from WebAssembly. This is a limitation of WebAssembly at the moment. In my experiments, it doesn't return anything at the moment, probably because it stores a pointer to the result somewhere but I don't know where exactly. Also, it appears to skip the first parameter for some reason. |
It was an incorrect backwards copy of a zero-length slice: even while being zero length, it tried to copy one byte. The bug should be fixed now. I still don't understand why the first parameter from JS is skipped. It looks like it happens during WebAssembly codegen (after all optimization passes etc. have run) because the function signature in the IR is correct: two i32 parameters. You can test that the function works by printing the resulting string to the console: println(page) |
wow fast turn around! oh yea my actual code isnt returning a string I just tried to hack it up to make sense in isolation. thanks so much for your work on this project! |
A little toy program I was working on keeps hitting an error in the webassembly code for slicecopy. I don't see anything obviously wrong, so it might be a bug. happens if I try and call
updatePage
from javascript.The text was updated successfully, but these errors were encountered: