cmd/compile: fix segfault in race instrumentation

Fixes #13265.

Change-Id: I792eb4ee26bef8a56e279e23f9802cb39019e0d0
Reviewed-on: https://go-review.googlesource.com/34929
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dhananjay Nakrani 2017-01-07 23:42:23 -08:00 committed by Matthew Dempsky
parent a9afa4e933
commit 4c8e8fc301
2 changed files with 18 additions and 0 deletions

View file

@ -2187,6 +2187,9 @@ func callnew(t *types.Type) *Node {
}
func iscallret(n *Node) bool {
if n == nil {
return false
}
n = outervalue(n)
return n.Op == OINDREGSP
}

View file

@ -0,0 +1,15 @@
// errorcheck -0 -race
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 13265: nil pointer deref.
package p
func f() {
var c chan chan chan int
for ; ; <-<-<-c {
}
}