From 8422d1ea65e4722098ec940e202a0aa33efa3309 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Tue, 15 Jul 2014 10:27:36 +0400 Subject: [PATCH] runtime: zero dangling pointer I don't see how it can lead to bad things today. But it's better to kill it before it does. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rsc https://golang.org/cl/111130045 --- src/pkg/runtime/chan.goc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pkg/runtime/chan.goc b/src/pkg/runtime/chan.goc index 7a584717bb..54b97697af 100644 --- a/src/pkg/runtime/chan.goc +++ b/src/pkg/runtime/chan.goc @@ -1105,6 +1105,8 @@ loop: if(sgp == nil) return nil; q->first = sgp->link; + if(q->last == sgp) + q->last = nil; // if sgp participates in a select and is already signaled, ignore it if(sgp->selectdone != nil) { -- 2.48.1