]> Cypherpunks repositories - gostls13.git/commitdiff
disallow other package's names in method calls
authorRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 23:35:07 +0000 (15:35 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 16 Jan 2009 23:35:07 +0000 (15:35 -0800)
R=ken
OCL=22999
CL=22999

src/cmd/gc/dcl.c

index d5ca7c4d73c905a8212828919bd15fbb73ac7f1a..e9e8f51aba23d665b3b6f70c9f14a7bb45fa5637 100644 (file)
@@ -290,6 +290,9 @@ addmethod(Node *n, Type *t, int local)
 
        pa = f;
 
+       if(pkgimportname != S && !exportname(sf->name))
+               sf = pkglookup(sf->name, pkgimportname->name);
+
        n = nod(ODCLFIELD, newname(sf), N);
        n->type = t;