]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: fix typo in gccgo name mangling recipe
authorThan McIntosh <thanm@google.com>
Tue, 6 Nov 2018 20:07:46 +0000 (15:07 -0500)
committerThan McIntosh <thanm@google.com>
Tue, 13 Nov 2018 15:34:54 +0000 (15:34 +0000)
The code to implement new-style gccgo name mangling had a recipe that
didn't quite match that of the compiler (incorrect handling for '.').
This showed up as a failure in the gotools cgo test if the directory
containing the test run included a "." character.

[This is a copy of https://golang.org/cl/147917].

Change-Id: Ia94728ecead879c8d223eb6cee6c102a8af1c86e
Reviewed-on: https://go-review.googlesource.com/c/147937
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/cgo/out.go

index c203873b130841da420dd750142dd1e93574c43a..bc0b0b63877a3f69454f530474ac00c65a4ef95c 100644 (file)
@@ -1271,7 +1271,7 @@ 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:
+                       '0' <= c && c <= '9', c == '_', c == '.':
                        bsl = append(bsl, c)
                default:
                        changed = true