]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: set importpkg.Direct correctly when using binary imports
authorRobert Griesemer <gri@golang.org>
Fri, 15 Jan 2016 22:52:06 +0000 (14:52 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 19 Jan 2016 18:28:08 +0000 (18:28 +0000)
Fixes #13977.

Change-Id: Icf54b4d2d746d30da207d1e17c975d18188b1cf8
Reviewed-on: https://go-review.googlesource.com/18702
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/compile/internal/gc/lex.go

index fb30d58527061055f4feb839d47974afa12a2e3d..01eb3a56560bcfb394f83e4758050e9541870123 100644 (file)
@@ -843,6 +843,13 @@ func importfile(f *Val, line int) {
                }
                p := fmt.Sprintf("package %s %s\n$$\n", importpkg.Name, tag)
                cannedimports(file, p)
+               // Reset incannedimport flag (we are not truly in a
+               // canned import) - this will cause importpkg.Direct to
+               // be set via parser.import_package (was issue #13977).
+               //
+               // TODO(gri) Remove this global variable and convoluted
+               // code in the process of streamlining the import code.
+               incannedimport = 0
 
        default:
                Yyerror("no import in %q", f.U.(string))