]> Cypherpunks repositories - gostls13.git/commitdiff
cgo: include line number information to keep go/printer happy
authorRuss Cox <rsc@golang.org>
Fri, 18 Dec 2009 01:04:48 +0000 (17:04 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 18 Dec 2009 01:04:48 +0000 (17:04 -0800)
Fixes #443.

R=dho
CC=golang-dev
https://golang.org/cl/179095

src/cmd/cgo/main.go

index c3e319f92c35d6d54eae53cc29a6c3ec768af6d5..d1b551b555707c9b19c03dbd58f0ee2654d0d0f4 100644 (file)
@@ -94,7 +94,8 @@ func main() {
                        case "call":
                                if !cref.TypeName {
                                        // Is an actual function call.
-                                       *cref.Expr = &ast.Ident{Value: "_C_" + cref.Name}
+                                       pos := (*cref.Expr).Pos()
+                                       *cref.Expr = &ast.Ident{Position: pos, Value: "_C_" + cref.Name}
                                        p.Funcdef[cref.Name] = cref.FuncType
                                        break
                                }