mirror of
https://github.com/golang/go
synced 2024-11-12 09:50:21 -07:00
runtime: fix integer overflow
The problem happens when end=0, then end-1 is very big number. Observed with the new scheduler. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7307073
This commit is contained in:
parent
6dfd386005
commit
45636db01b
@ -145,7 +145,7 @@ runtime·parfordo(ParFor *desc)
|
||||
// See if it has any work.
|
||||
begin = (uint32)pos;
|
||||
end = (uint32)(pos>>32);
|
||||
if(begin >= end-1) {
|
||||
if(begin+1 >= end) {
|
||||
begin = end = 0;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user