mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
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/17457 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c5a94ba24f
commit
b9fde8605e
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue