]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix constant pointer comparison failure
authorMatthew Dempsky <mdempsky@google.com>
Sat, 7 Apr 2018 10:08:46 +0000 (03:08 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 9 Apr 2018 23:19:45 +0000 (23:19 +0000)
commitfe77a5413e64049af456b14ae911102681bee006
tree60cf4b2f182f22bf1afbf86b1376bc6aea4669cf
parentc3473c4f10c93189cf312576df2ce05202948e52
cmd/compile: fix constant pointer comparison failure

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>
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/export.go
test/const1.go
test/fixedbugs/issue21221.go [new file with mode: 0644]