1
0
mirror of https://github.com/golang/go synced 2024-11-22 23:50:03 -07:00
go/test/fixedbugs/issue54722b.go
Cuong Manh Le ddc93a536f cmd/compile: fix unified IR shapifying recursive instantiated types
Shape-based stenciling in unified IR is done by converting type argument
to its underlying type. So it agressively check that type argument is
not a TFORW. However, for recursive instantiated type argument, it may
still be a TFORW when shapifying happens. Thus the assertion failed,
causing the compiler crashing.

To fix it, just allow fully instantiated type when shapifying.

Fixes #54512
Fixes #54722

Change-Id: I527e3fd696388c8a37454e738f0324f0c2ec16cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/426335
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-08-30 17:23:27 +00:00

31 lines
523 B
Go

// compile
// Copyright 2022 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.
package p
type value[V comparable] struct {
node *node[value[V]]
value V
}
type node[V comparable] struct {
index *index[V]
children map[string]*node[V]
}
type index[V comparable] struct {
arrays []array[V]
}
type array[V comparable] struct {
valueMap map[int]V
}
var x value[int]
var y value[*Column]
type Column struct{ column int }