Commit b9fde860 authored by Russ Cox's avatar Russ Cox

runtime: fix integer comparison in signal handling

(sig is unsigned, so sig-1 >= 0 is always true.)

Fixes #11281.

Change-Id: I4b9d784da6e3cc80816f2d2f7228d5d8a237e2d5
Reviewed-on: https://go-review.googlesource.com/17457Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent c5a94ba2
......@@ -228,11 +228,11 @@ func ensureSigM() {
for {
select {
case sig := <-enableSigChan:
if b := sig - 1; b >= 0 {
if b := sig - 1; sig > 0 {
sigBlocked[b/32] &^= (1 << (b & 31))
}
case sig := <-disableSigChan:
if b := sig - 1; b >= 0 {
if b := sig - 1; sig > 0 {
sigBlocked[b/32] |= (1 << (b & 31))
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment