libgo: better cmd/cgo handling for '.' in pkgpath
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 19 Nov 2019 23:04:08 +0000 (23:04 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 19 Nov 2019 23:04:08 +0000 (23:04 +0000)
    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

gcc/go/gofrontend/MERGE
libgo/go/cmd/cgo/out.go

index a981bb86c2d88c4914196e264e6449000bdc30f9..4eab78b36b467118581efb2b05542a3c13d1c749 100644 (file)
@@ -1,4 +1,4 @@
-25d5e9dca49ad3f49393b254dd87f8df51487c65
+245904ac148f15db530fb8d50f526c47d08024c5
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 7282933e3c5be8da3d0d67cc1ed629546e6986ca..97886e1abd0b0ed074b5a758a39eff07366b8d96 100644 (file)
@@ -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))