mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
![Matthew Dempsky](/assets/img/avatar_default.png)
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>
19 lines
365 B
Go
19 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")
|
|
}
|
|
}
|