0
1
mirror of https://github.com/golang/go synced 2024-12-11 15:21:00 +00:00
go/test/fixedbugs/issue70156.go
Youlin Feng cb163ff60b cmd/compile: init limit for newly created value in prove pass
Fixes: #70156

Change-Id: I2e5dc2a39a8e54ec5f18c5f9d1644208cffb2e9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/624695
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-11-05 16:55:14 +00:00

24 lines
428 B
Go

// run
// Copyright 2024 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
import (
"reflect"
)
func main() {
pi := new(interface{})
v := reflect.ValueOf(pi).Elem()
if v.Kind() != reflect.Interface {
panic(0)
}
if (v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface) && v.IsNil() {
return
}
panic(1)
}