diff options
| author | Dan Gohman <sunfish@mozilla.com> | 2015-06-05 14:33:09 -0700 |
|---|---|---|
| committer | Dan Gohman <sunfish@mozilla.com> | 2015-06-10 09:28:21 -0700 |
| commit | aaa50db3bd0d1f783f6f2db5da26e3e8fbae12f3 (patch) | |
| tree | 9e410708b3891baa953bb87d2785e601b8979271 /Polyfill.md | |
| parent | 6525f08e1c9a3a7905b60d83616c3e0e80dabe30 (diff) | |
| download | nanowasm-design-aaa50db3bd0d1f783f6f2db5da26e3e8fbae12f3.tar.gz | |
Make INT32_MIN%-1 trap.
It doesn't actually overflow, but the corresponding division overflows,
so even though we could define it to be correct, it isn't especially
useful. Also, this operation is UB in C and LLVM.
Diffstat (limited to 'Polyfill.md')
| -rw-r--r-- | Polyfill.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Polyfill.md b/Polyfill.md index 5a8ec93..ce215f8 100644 --- a/Polyfill.md +++ b/Polyfill.md @@ -65,6 +65,7 @@ Some divergences that we've identified as potentially desirable: standard behavior: - Division by zero returns zero; - `INT32_MIN / -1` returns `INT32_MIN`; + - `INT32_MIN % -1` returns `0`; - Shift counts are implicitly masked. * **[Datatype conversions](AstSemantics.md#datatype-conversions-truncations-reinterpretations-promotions-and-demotions)**: Regardless of WebAssembly behavior, an asm.js polyfill will follow its |
