mirror of
https://github.com/golang/go
synced 2024-11-19 00:54:42 -07:00
export
R=r OCL=16018 CL=16022
This commit is contained in:
parent
566e3b2043
commit
8545700af8
@ -386,6 +386,9 @@ agen(Node *n, Node *res)
|
|||||||
// i is in &n1
|
// i is in &n1
|
||||||
// w is width
|
// w is width
|
||||||
|
|
||||||
|
if(w == 0)
|
||||||
|
fatal("index is zero width");
|
||||||
|
|
||||||
if(isptrdarray(nl->type)) {
|
if(isptrdarray(nl->type)) {
|
||||||
regalloc(&n2, types[tptr], res);
|
regalloc(&n2, types[tptr], res);
|
||||||
gmove(res, &n2);
|
gmove(res, &n2);
|
||||||
|
@ -506,14 +506,17 @@ importaddtyp(Node *ss, Type *t)
|
|||||||
Sym *s;
|
Sym *s;
|
||||||
|
|
||||||
s = getimportsym(ss);
|
s = getimportsym(ss);
|
||||||
if(s->otype != T && !eqtype(t, s->otype, 0)) {
|
if(s->otype != T) {
|
||||||
if(!isptrto(t, TFORW))
|
// here we should try to discover if
|
||||||
yyerror("import redeclaration of %lS %lT => %lT\n",
|
// the new type is the same as the old type
|
||||||
|
if(eqtype(t, s->otype, 0))
|
||||||
|
return;
|
||||||
|
if(isptrto(t, TFORW))
|
||||||
|
return; // hard part
|
||||||
|
warn("redeclare import %S from %lT to %lT",
|
||||||
s, s->otype, t);
|
s, s->otype, t);
|
||||||
s->otype = t;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s->otype == T)
|
|
||||||
addtyp(newtype(s), t, PEXTERN);
|
addtyp(newtype(s), t, PEXTERN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user