3 // Copyright 2021 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // This tickles a stack-allocation bug when the register ABI is enabled.
8 // The original report was from cue, internal/core/adt/equality.go,
9 // function equalVertex.
11 // In the failing case, something bad gets passed to equalTerminal.
22 TopKind Kind = (allKinds - 1)
24 type Value interface {
31 func (v *Vertex) Kind() Kind {
36 vA := &Vertex{name:"vA",}
37 vB := &Vertex{name:"vB",}
38 vX := &Vertex{name:"vX",}
41 _ = equalVertex(vA, vB, Flag(1))
47 func (v *Vertex) IsClosedStruct() bool {
51 func equalVertex(x *Vertex, v Value, flags Flag) bool {
56 v, ok1 := x.BaseValue.(Value)
57 w, ok2 := y.BaseValue.(Value)
59 return true // both are struct or list.
61 return equalTerminal(v, w, flags)
65 func equalTerminal(x Value, y Value, flags Flag) bool {
66 foo = fmt.Sprintf("EQclosed %s %s %d\n", x.(*Vertex).name, y.(*Vertex).name, flags)