From aec4d3194afaf29de1c30a7bf0528dec0a344879 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 16 Jan 2009 15:35:07 -0800 Subject: [PATCH] disallow other package's names in method calls R=ken OCL=22999 CL=22999 --- src/cmd/gc/dcl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c index d5ca7c4d73c..e9e8f51aba2 100644 --- a/src/cmd/gc/dcl.c +++ b/src/cmd/gc/dcl.c @@ -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;