soundandform / m3

A high performance WebAssembly interpreter in C. Moved here:
https://github.com/wasm3/wasm3
MIT License
17 stars 1 forks source link

Trap #4

Open sanxiyn opened 5 years ago

sanxiyn commented 5 years ago

On README I read:

Traps: The spec says "Signed and unsigned operators trap whenever the result cannot be represented in the result type." Really? That's cool, but how can the behavior of source languages be modeled (efficiently)? C integer operations wrap and sometimes that's what you want.

Where does the spec say this? I can't find it. https://webassembly.github.io/spec/core/exec/numerics.html is pretty clear that addition is done modulo 2^N, for example.