From c14c961ae42a8555578c1ecacddca375929895bd Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 24 Oct 2008 14:32:48 -0700 Subject: [PATCH] Automated g4 rollback of changelist 17815. *** Reason for rollback *** now it's comparing function parameter names... *** Original change description *** fix method function type compare bug R=ken OCL=17816 CL=17816 --- src/cmd/gc/dcl.c | 7 ++----- src/cmd/gc/subr.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c index 9f888484dc..f836f3ba74 100644 --- a/src/cmd/gc/dcl.c +++ b/src/cmd/gc/dcl.c @@ -279,10 +279,8 @@ addmethod(Node *n, Type *t, int local) d = f; continue; } - if(!eqtype(t, f->type, 0)) { + if(!eqtype(t, f->type, 0)) yyerror("method redeclared: %S of type %S", sf, st); - print("\t%T\n\t%T\n", f->type, t); - } return; } @@ -342,8 +340,7 @@ funchdr(Node *n) if(!eqargs(n->type, on->type)) yyerror("forward declarations not the same: %S", s); } else { - yyerror("function redeclared: %S", s); - print("\t%T\n\t%T\n", on->type, n->type); + yyerror("redeclare of function: %S", s); on = N; } } diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index dfe5913d21..4e1a9ea3a3 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -1773,7 +1773,7 @@ eqtype(Type *t1, Type *t2, int d) if(t1->etype != TSTRUCT || t2->etype != TSTRUCT) return 0; - if(!eqtype(t1, t2, 0)) + if(!eqtype(t1->type, t2->type, 0)) return 0; t1 = t1->down;