1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:24:42 -07:00

6l: more invalid input files

Fixes #963.
Fixes #964.

R=r
CC=golang-dev
https://golang.org/cl/1874045
This commit is contained in:
Russ Cox 2010-07-26 17:34:02 -07:00
parent bbf925aa56
commit 9a442211c6
2 changed files with 13 additions and 10 deletions

View File

@ -427,21 +427,15 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
}
if(t & T_TYPE)
a->type = Bgetc(f);
if(a->type < 0 || a->type >= D_SIZE)
mangle(pn);
adrgotype = S;
if(t & T_GOTYPE)
adrgotype = zsym(pn, f, h);
s = a->sym;
if(s == S) {
switch(a->type) {
case D_SIZE:
mangle(pn);
}
return;
}
t = a->type;
if(t != D_AUTO && t != D_PARAM) {
if(adrgotype)
if(s && adrgotype)
s->gotype = adrgotype;
return;
}
@ -582,6 +576,15 @@ loop:
fromgotype = adrgotype;
zaddr(pn, f, &p->to, h);
switch(p->as) {
case ATEXT:
case ADATA:
case AGLOBL:
if(p->from.sym == S)
mangle(pn);
break;
}
if(debug['W'])
print("%P\n", p);

View File

@ -904,6 +904,6 @@ iconv(Fmt *fp)
void
mangle(char *file)
{
fprint(2, "%s; mangled input file\n", file);
fprint(2, "%s: mangled input file\n", file);
errorexit();
}