aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-09-03 23:35:13 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-09-03 23:35:13 +0000
commit2974ecdae50dbeb7d0cec04f18d5f627ed79629b (patch)
tree4d306578609880333c3ce69c41f1838aa4a34ea5 /gcc/go
parent64be2b26eb94fcb4d4e754aeb06e868535f33169 (diff)
downloadgcc-2974ecdae50dbeb7d0cec04f18d5f627ed79629b.zip
gcc-2974ecdae50dbeb7d0cec04f18d5f627ed79629b.tar.gz
gcc-2974ecdae50dbeb7d0cec04f18d5f627ed79629b.tar.bz2
compiler: only import variable into . if same package
If we dot-import a package, we should only add an imported variable to the package bindings if the variable is in the package being imported. A test case for this is the 1.13 os package, in which ErrClosed and friends are defined both locally and in the imported internal/oserror package. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192718 From-SVN: r275358
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/import.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 0add2f0..b334136 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-3b8a505824abb2a69f4c04c555a4ba29ab8b102b
+ca0fdb4c7735a648b8f10f1248631adf9afb8454
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc
index 64c1ef2..bbc8d7d 100644
--- a/gcc/go/gofrontend/import.cc
+++ b/gcc/go/gofrontend/import.cc
@@ -777,7 +777,7 @@ Import::import_var()
this->location_);
Named_object* no;
no = vpkg->add_variable(name, var);
- if (this->add_to_globals_)
+ if (this->add_to_globals_ && vpkg == this->package_)
this->gogo_->add_dot_import_object(no);
}