Closed Yu-zh closed 10 months ago
There are no negative sizes, since they are unsigned. The code is trying to allocate a very large array with 0xffff_fffc elements. The behaviour of a Wasm engine in the case of resource exhaustion isn't specified, similar to e.g. stack overflow.
@rossberg Thanks. That makes sense.
Hello, I wanted to ask what is the expected behavior on initializing array with negative size. I have tried the following program
I build the spec interpreter, and run
./wasm index.wat -e "(invoke \"_start\")"
. Then the interpreter hangs. I also try it on Chrome, and it says RuntimeError: requested new array is too large.