mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
fb2af2b35b
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>
17 lines
349 B
Go
17 lines
349 B
Go
// 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}
|
|
}
|