From: Robert Griesemer Date: Tue, 23 Aug 2016 18:20:34 +0000 (-0700) Subject: cmd/compile: add comment X-Git-Tag: go1.8beta1~1677 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=874ea6a4c7fc402ff05a8e63dea5d1b41d55930e;p=gostls13.git 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 --- 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)