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 /AstSemantics.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 'AstSemantics.md')
| -rw-r--r-- | AstSemantics.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AstSemantics.md b/AstSemantics.md index 04baf1a..c2bc466 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -307,7 +307,8 @@ and 0 representing false. * Int32Ule - unsigned less than or equal Division or remainder by zero traps. -Signed division overflow (e.g. INT32_MIN/-1) traps. +Signed division overflow (INT32_MIN/-1) and the corresponding signed +remainder operation (INT32_MIN%-1) trap. Shifts interpret their shift count operand as an unsigned value. When the shift count is at least the bitwidth of the shift, Shl and Shr return 0, |
