mirror of
https://github.com/golang/go
synced 2024-11-24 20:50:11 -07:00
e49627d355
Prevent a crash if the same type in two plugins had a recursive definition, either by referring to a pointer to itself or a map existing with the type as a value type (which creates a recursive definition through the overflow bucket type). Fixes #19258 Change-Id: Iac1cbda4c5b6e8edd5e6859a4d5da3bad539a9c6 Reviewed-on: https://go-review.googlesource.com/40292 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
24 lines
471 B
Go
24 lines
471 B
Go
// 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.
|
|
|
|
package main
|
|
|
|
// // No C code required.
|
|
import "C"
|
|
|
|
func FuncInt() int { return 1 }
|
|
|
|
// Add a recursive type to to check that type equality across plugins doesn't
|
|
// crash. See https://golang.org/issues/19258
|
|
func FuncRecursive() X { return X{} }
|
|
|
|
type Y struct {
|
|
X *X
|
|
}
|
|
type X struct {
|
|
Y Y
|
|
}
|
|
|
|
func main() {}
|