mirror of
https://github.com/golang/go
synced 2024-11-02 11:50:30 +00:00
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:
parent
a9afa4e933
commit
4c8e8fc301
2 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
15
test/fixedbugs/issue13265.go
Normal file
15
test/fixedbugs/issue13265.go
Normal 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 {
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue