diff mbox

[gccgo] Fix bug importing package with same name as current package

Message ID mcr4oguls9k.fsf@dhcp-172-17-9-151.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor June 22, 2010, 8:35 p.m. UTC
This patch fixes a bug when importing a package whose name is the same
as the current package, but which lives in a different directory.
Committed to gccgo branch.

Ian
diff mbox

Patch

diff -r fafa9c01a826 go/gogo.cc
--- a/go/gogo.cc	Tue Jun 22 11:37:46 2010 -0700
+++ b/go/gogo.cc	Tue Jun 22 13:31:02 2010 -0700
@@ -443,7 +443,8 @@ 
 {
   // FIXME: Now that we compile packages as a whole, should we permit
   // importing the current package?
-  if (this->package_name() == real_name)
+  if (this->package_name() == real_name
+      && this->unique_prefix() == unique_prefix)
     {
       *padd_to_globals = false;
       if (!alias_arg.empty() && alias_arg != ".")