From 0c6ce0ae553a9a73bf4eb27d16ee751167806f8d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 19 Nov 2019 23:04:08 +0000 Subject: libgo: better cmd/cgo handling for '.' in pkgpath Updates cgo's gccgoPkgpathToSymbolNew() to bring it into conformance with the way that gccgo now handles package paths with embedded dots (see CL 200838). See also https://gcc.gnu.org/PR61880, a related bug. This CL is a copy of CL 207957 in the main Go repo. Updates golang/go#35623. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207977 From-SVN: r278470 --- libgo/go/cmd/cgo/out.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libgo/go') diff --git a/libgo/go/cmd/cgo/out.go b/libgo/go/cmd/cgo/out.go index 7282933..97886e1 100644 --- a/libgo/go/cmd/cgo/out.go +++ b/libgo/go/cmd/cgo/out.go @@ -1318,8 +1318,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)) -- cgit v1.1