aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/export.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2018-04-07 03:08:46 -0700
committerMatthew Dempsky <mdempsky@google.com>2018-04-09 23:19:45 +0000
commitfe77a5413e64049af456b14ae911102681bee006 (patch)
tree60cf4b2f182f22bf1afbf86b1376bc6aea4669cf /src/cmd/compile/internal/gc/export.go
parentc3473c4f10c93189cf312576df2ce05202948e52 (diff)
downloadgo-fe77a5413e64049af456b14ae911102681bee006.tar.gz
go-fe77a5413e64049af456b14ae911102681bee006.zip
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>
Diffstat (limited to 'src/cmd/compile/internal/gc/export.go')
-rw-r--r--src/cmd/compile/internal/gc/export.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/export.go b/src/cmd/compile/internal/gc/export.go
index a583728608..f0fdc5bd25 100644
--- a/src/cmd/compile/internal/gc/export.go
+++ b/src/cmd/compile/internal/gc/export.go
@@ -145,7 +145,7 @@ func importconst(pos src.XPos, pkg *types.Pkg, s *types.Sym, t *types.Type, val
}
n := npos(pos, nodlit(val))
- n = convlit1(n, t, false, reuseOK)
+ n.Type = t
n.Sym = s
declare(n, PEXTERN)