]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: better handling for '.' in pkgpath for gccgo
authorThan McIntosh <thanm@google.com>
Tue, 19 Nov 2019 15:09:28 +0000 (10:09 -0500)
committerThan McIntosh <thanm@google.com>
Tue, 19 Nov 2019 19:38:07 +0000 (19:38 +0000)
Update gccgoPkgpathToSymbolNew() to bring it into conformance
with the way that gccgo now handles packagepaths with embedded
dots (see CL 200838). See also https://gcc.gnu.org/PR61880, a
related bug.

Updates #35623.

Change-Id: I32f064320b9af387fc17771530c745a9e3003c20
Reviewed-on: https://go-review.googlesource.com/c/go/+/207957
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/out.go

index 6bee9b1909f42c5cd2f5a6867ea548eb80641f31..e32a3a607bbafa2e6a283ee1764f416104b92cf8 100644 (file)
@@ -1313,8 +1313,10 @@ func gccgoPkgpathToSymbolNew(ppath string) string {
        for _, c := range []byte(ppath) {
                switch {
                case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z',
-                       '0' <= c && c <= '9', c == '_', c == '.':
+                       '0' <= c && c <= '9', c == '_':
                        bsl = append(bsl, c)
+               case c == '.':
+                       bsl = append(bsl, ".x2e"...)
                default:
                        changed = true
                        encbytes := []byte(fmt.Sprintf("..z%02x", c))