Commit 1b1f1b53 authored by Russ Cox's avatar Russ Cox

correct signature generation decision

for non-pointer types with methods.

R=r
DELTA=37  (13 added, 14 deleted, 10 changed)
OCL=22217
CL=22219
parent c458c983
...@@ -612,9 +612,9 @@ out: ...@@ -612,9 +612,9 @@ out:
} }
void void
dumpsigt(Type *t0, Sym *s) dumpsigt(Type *t0, Type *t, Sym *s)
{ {
Type *f, *t; Type *f;
Sym *s1; Sym *s1;
int o; int o;
Sig *a, *b; Sig *a, *b;
...@@ -623,12 +623,6 @@ dumpsigt(Type *t0, Sym *s) ...@@ -623,12 +623,6 @@ dumpsigt(Type *t0, Sym *s)
at.sym = s; at.sym = s;
t = t0;
if(isptr[t->etype] && t->type->sym != S) {
t = t->type;
expandmeth(t->sym, t);
}
a = nil; a = nil;
o = 0; o = 0;
for(f=t->method; f!=T; f=f->down) { for(f=t->method; f!=T; f=f->down) {
...@@ -815,7 +809,7 @@ dumpsignatures(void) ...@@ -815,7 +809,7 @@ dumpsignatures(void)
{ {
int et; int et;
Dcl *d, *x; Dcl *d, *x;
Type *t; Type *t, *t0;
Sym *s, *s1; Sym *s, *s1;
Prog *p; Prog *p;
...@@ -893,22 +887,27 @@ dumpsignatures(void) ...@@ -893,22 +887,27 @@ dumpsignatures(void)
// don't emit non-trivial signatures for types defined outside this file. // don't emit non-trivial signatures for types defined outside this file.
// non-trivial signatures might also drag in generated trampolines, // non-trivial signatures might also drag in generated trampolines,
// and ar can't handle duplicates of the trampolines. // and ar can't handle duplicates of the trampolines.
s1 = S; // only pay attention to types with symbols, because
if(isptr[et] && t->type != T) { // the ... structs and maybe other internal structs
s1 = t->type->sym; // don't get marked as local.
if(s1 && !t->type->local)
// interface is easy
if(et == TINTER) {
if(t->sym && !t->local)
continue; continue;
} dumpsigi(t, s);
else if(et == TINTER) {
s1 = t->sym;
if(s1 && !t->local)
continue; continue;
} }
if(et == TINTER) // if there's a pointer, methods are on base.
dumpsigi(t, s); t0 = t;
else if(isptr[et] && t->type->sym != S) {
dumpsigt(t, s); t = t->type;
expandmeth(t->sym, t);
}
if(t->method && t->sym && !t->local)
continue;
dumpsigt(t0, t, s);
} }
if(stringo > 0) { if(stringo > 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment