From 38e11d05b9f563ca6588f020c40dbac7d4850fc2 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Wed, 30 Mar 2016 14:26:04 -0700 Subject: [PATCH] cmd/compile: use *byte for pointer to string memory Change-Id: I14cff013ef4920d33b5ead0c75d51681bb4f635a Reviewed-on: https://go-review.googlesource.com/21337 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/cgen.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/gc/cgen.go b/src/cmd/compile/internal/gc/cgen.go index 4b2bf456b1a..c594ad4c110 100644 --- a/src/cmd/compile/internal/gc/cgen.go +++ b/src/cmd/compile/internal/gc/cgen.go @@ -3469,11 +3469,7 @@ func cgen_slice(n, res *Node, wb bool) { } else { var ptr *Type if n.Op == OSLICESTR { - // Yikes! Ptrto(nil)?! - // Prior to CL 21331, that's what this code did implicitly. - // Now it does it explicitly, to safely preserve old behavior. - // This will all be replaced by SSA anyway. - ptr = Ptrto(nil) + ptr = ptrToUint8 } else { ptr = Ptrto(n.Type.Elem()) }