From 874ea6a4c7fc402ff05a8e63dea5d1b41d55930e Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 23 Aug 2016 11:20:34 -0700 Subject: [PATCH] cmd/compile: add comment Minor update on https://go-review.googlesource.com/27441 . Change-Id: I605a8bfbe67e259020aa53f1d2357808197d02b6 Reviewed-on: https://go-review.googlesource.com/27631 Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/bimport.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/compile/internal/gc/bimport.go b/src/cmd/compile/internal/gc/bimport.go index dfe102b78a..00d5a702ca 100644 --- a/src/cmd/compile/internal/gc/bimport.go +++ b/src/cmd/compile/internal/gc/bimport.go @@ -807,6 +807,10 @@ func (p *importer) node() *Node { typ := p.typ() n := nodlit(p.value(typ)) if !typ.IsUntyped() { + // Type-checking simplifies unsafe.Pointer(uintptr(c)) + // to unsafe.Pointer(c) which then cannot type-checked + // again. Re-introduce explicit uintptr(c) conversion. + // (issue 16317). if typ.IsUnsafePtr() { conv := Nod(OCALL, typenod(Types[TUINTPTR]), nil) conv.List.Set1(n) -- 2.48.1