Commit 92ba69d2 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: set importpkg.Direct correctly when using binary imports

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: default avatarAlan Donovan <adonovan@google.com>
parent 5e7110b9
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment