| author | |
| committer | |
| log | b3a40743580c1aca6b6f5d212d3b307d4fd1f16b |
| tree | 9ecbcef12adf55c410e8d849762d90073de77dc8 |
| parent | 46f93807aaf4d9c1ea2000cda5ad46ea6f212b3e |
The intermediate value can be larger than an u16, so @truncate is needed
to match the behavior of musl.3 files changed, 3 insertions(+), 3 deletions(-)
lib/std/os/bits/dragonfly.zig+1-1| ... | ... | @@ -345,7 +345,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 345 | 345 | return WTERMSIG(s) == 0; |
| 346 | 346 | } |
| 347 | 347 | pub fn WIFSTOPPED(s: u32) bool { |
| 348 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | |
| 348 | return @truncate(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | |
| 349 | 349 | } |
| 350 | 350 | pub fn WIFSIGNALED(s: u32) bool { |
| 351 | 351 | return (s & 0xffff) -% 1 < 0xff; |
lib/std/os/bits/freebsd.zig+1-1| ... | ... | @@ -742,7 +742,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 742 | 742 | return WTERMSIG(s) == 0; |
| 743 | 743 | } |
| 744 | 744 | pub fn WIFSTOPPED(s: u32) bool { |
| 745 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | |
| 745 | return @truncate(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | |
| 746 | 746 | } |
| 747 | 747 | pub fn WIFSIGNALED(s: u32) bool { |
| 748 | 748 | return (s & 0xffff) -% 1 < 0xff; |
lib/std/os/bits/linux.zig+1-1| ... | ... | @@ -1061,7 +1061,7 @@ pub fn WIFEXITED(s: u32) bool { |
| 1061 | 1061 | return WTERMSIG(s) == 0; |
| 1062 | 1062 | } |
| 1063 | 1063 | pub fn WIFSTOPPED(s: u32) bool { |
| 1064 | return @intCast(u16, ((s & 0xffff) *% 0x10001) >> 8) > 0x7f00; | |
| 1064 | return @truncate(u16, ((s & 0xffff) *% 0x10001) >> 8) > 0x7f00; | |
| 1065 | 1065 | } |
| 1066 | 1066 | pub fn WIFSIGNALED(s: u32) bool { |
| 1067 | 1067 | return (s & 0xffff) -% 1 < 0xff; |