mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
fe77a5413e
Previously, constant pointer-typed expressions could use either Mpint or NilVal as their Val depending on their construction, but const.go expects each type to have a single corresponding Val kind. This CL changes pointer-typed expressions to exclusively use Mpint. Fixes #21221. Change-Id: I6ba36c9b11eb19a68306f0b296acb11a8c254c41 Reviewed-on: https://go-review.googlesource.com/105315 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
18 lines
365 B
Go
18 lines
365 B
Go
// run
|
|
|
|
// Copyright 2018 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 "unsafe"
|
|
|
|
func main() {
|
|
if unsafe.Pointer(uintptr(0)) != unsafe.Pointer(nil) {
|
|
panic("fail")
|
|
}
|
|
if (*int)(unsafe.Pointer(uintptr(0))) != (*int)(nil) {
|
|
panic("fail")
|
|
}
|
|
}
|