1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:10:24 -07:00
go/test/fixedbugs/issue14405.go
David Chase fb2af2b35b 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>
2016-02-19 19:40:49 +00:00

18 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}
}