mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: don't walk field-name syntax in esc.go
Walking the field name as if it were an expression caused a called to haspointers with a TFIELD, which panics. Trigger was a field at a large offset within a large struct, combined with a struct literal expression mentioning that field. Fixes #14405 Change-Id: I4589badae27cf3d7cf365f3a66c13447512f41f9 Reviewed-on: https://go-review.googlesource.com/19699 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
0e34737c9a
commit
fb2af2b35b
3 changed files with 28 additions and 4 deletions
17
test/fixedbugs/issue14405.go
Normal file
17
test/fixedbugs/issue14405.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// compile
|
||||
|
||||
// Copyright 2016 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.
|
||||
|
||||
// Mention of field with large offset in struct literal causes crash
|
||||
package p
|
||||
|
||||
type T struct {
|
||||
Slice [1 << 20][]int
|
||||
Ptr *int
|
||||
}
|
||||
|
||||
func New(p *int) *T {
|
||||
return &T{Ptr: p}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue