1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:50:24 -07:00

runtime: fix heap corruption

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7397049
This commit is contained in:
Dmitriy Vyukov 2013-02-21 21:59:46 +04:00
parent 0cdc0b3b78
commit 94fab3cad3

View File

@ -972,6 +972,12 @@ runtime·newextram(void)
mp->locked = LockInternal; mp->locked = LockInternal;
mp->lockedg = gp; mp->lockedg = gp;
gp->lockedm = mp; gp->lockedm = mp;
// put on allg for garbage collector
if(runtime·lastg == nil)
runtime·allg = gp;
else
runtime·lastg->alllink = gp;
runtime·lastg = gp;
schedunlock(); schedunlock();
// Add m to the extra list. // Add m to the extra list.