diff options
author | Than McIntosh <thanm@google.com> | 2019-11-19 10:09:28 -0500 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2019-11-19 19:38:07 +0000 |
commit | 2933e938bf9451a6f4551056b672cd7fc467e94d (patch) | |
tree | d921a037a5af62eb0a95ac5bd70972f3971dadcb /src/cmd/cgo | |
parent | e0306c1d62d7d10e1e5239f51e01792b28e8001b (diff) | |
download | go-2933e938bf9451a6f4551056b672cd7fc467e94d.tar.gz go-2933e938bf9451a6f4551056b672cd7fc467e94d.zip |
cmd/cgo: better handling for '.' in pkgpath for gccgo
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>
Diffstat (limited to 'src/cmd/cgo')
-rw-r--r-- | src/cmd/cgo/out.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 6bee9b1909..e32a3a607b 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -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)) |