mirror of
https://github.com/golang/go
synced 2024-11-23 14:30:02 -07:00
1d004fa201
CL 364377 emitted definition of 'any' when compiling runtime. But 'any' is only available when generic enabled. Thus emitting its definition unconditionally causes the compiler crashes. Updates #49619 Change-Id: I0888ca1cbc7a7df300310a99a344f170636333f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/364614 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Trust: Dan Scales <danscales@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
20 lines
338 B
Go
20 lines
338 B
Go
// build -gcflags=-G=3
|
|
|
|
// Copyright 2021 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.
|
|
|
|
// This testcase caused a linker crash in DWARF generation.
|
|
|
|
package main
|
|
|
|
//go:noinline
|
|
func f() any {
|
|
var a []any
|
|
return a[0]
|
|
}
|
|
|
|
func main() {
|
|
f()
|
|
}
|