diff options
author | Russ Cox <rsc@golang.org> | 2009-09-01 18:04:49 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-09-01 18:04:49 -0700 |
commit | d0fa6c11b2ba13b1d88129635ee512e4f687dda1 (patch) | |
tree | 82ff3d0d4e3220d872a79b1558a846546bcc3d52 /src | |
parent | bb941a6681176a60acfbbc6de64eff24884fdbee (diff) | |
download | golang-d0fa6c11b2ba13b1d88129635ee512e4f687dda1.tar.gz |
type switch bug involving function parameter names
R=ken
OCL=34232
CL=34232
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/gc/subr.c | 8 | ||||
-rw-r--r-- | src/cmd/gc/swt.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 9eb92f0bb..0c436de0b 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -1920,8 +1920,12 @@ typehash(Type *at, int addsym, int d) break; case TSTRUCT: - for(t=at->type; t!=T; t=t->down) - h += PRIME7 * typehash(t, addsym, d+1); + for(t=at->type; t!=T; t=t->down) { + if(at->funarg) // walk into TFIELD in function argument struct + h += PRIME7 * typehash(t->type, addsym, d+1); + else + h += PRIME7 * typehash(t, addsym, d+1); + } break; case TFUNC: diff --git a/src/cmd/gc/swt.c b/src/cmd/gc/swt.c index 17a443348..0754d18f5 100644 --- a/src/cmd/gc/swt.c +++ b/src/cmd/gc/swt.c @@ -387,7 +387,7 @@ mkcaselist(Node *sw, int arg) continue; setlineno(c1->link->node); yyerror("duplicate case in switch"); - print(" previous case at %L\n", + print("\tprevious case at %L\n", c1->node->lineno); } break; @@ -400,7 +400,7 @@ mkcaselist(Node *sw, int arg) continue; setlineno(c1->link->node); yyerror("duplicate case in switch"); - print(" previous case at %L\n", + print("\tprevious case at %L\n", c1->node->lineno); } break; |