]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add comment
authorRobert Griesemer <gri@golang.org>
Tue, 23 Aug 2016 18:20:34 +0000 (11:20 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 23 Aug 2016 18:22:44 +0000 (18:22 +0000)
Minor update on https://go-review.googlesource.com/27441 .

Change-Id: I605a8bfbe67e259020aa53f1d2357808197d02b6
Reviewed-on: https://go-review.googlesource.com/27631
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/bimport.go

index dfe102b78a2b501dd45bf95f48da70b5f89def6f..00d5a702ca0604426480bc8e910dc028b20d0853 100644 (file)
@@ -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)