disallow other package's names in struct field dot.

R=ken
OCL=22996
CL=22996
This commit is contained in:
Russ Cox 2009-01-16 15:25:52 -08:00
parent 03c40f5122
commit 06869eedf9
3 changed files with 4 additions and 0 deletions

View file

@ -512,6 +512,8 @@ loop:
f->nname = n->left;
f->embedded = n->embedded;
f->sym = f->nname->sym;
if(pkgimportname != S && !exportname(f->sym->name))
f->sym = pkglookup(f->sym->name, pkgimportname->name);
}
*t = f;

View file

@ -741,6 +741,7 @@ void constiter(Node*, Type*, Node*);
*/
void renamepkg(Node*);
void autoexport(Sym*);
int exportname(char*);
void exportsym(Sym*);
void packagesym(Sym*);
void dumpe(Sym*);

View file

@ -160,6 +160,7 @@ import_there:
{
checkimports();
unimportfile();
pkgimportname = S;
}
| LIMPORT '$' '$' hidden_import_list '$' '$'
{