summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-06-07 02:05:08 -0400
committerRuss Cox <rsc@golang.org>2012-06-07 02:05:08 -0400
commit3fb6339b3f803278c35f5bc7233d737b6fe1c671 (patch)
tree0d74e11ae66471dc4c5c8cf02020e17b0bd2d5db /src/cmd/gc/subr.c
parent4faf52e94dee668d2b06419e14f89de7f9f9a98f (diff)
downloadgo-3fb6339b3f803278c35f5bc7233d737b6fe1c671.tar.gz
cmd/gc: do not crash on struct with _ field
Fixes issue 3607. R=ken2 CC=golang-dev http://codereview.appspot.com/6296052
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r--src/cmd/gc/subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index dfab86864..1bb83272c 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -2684,7 +2684,7 @@ genhash(Sym *sym, Type *t)
first = T;
for(t1=t->type;; t1=t1->down) {
if(t1 != T && (isblanksym(t1->sym) || algtype1(t1->type, nil) == AMEM)) {
- if(first == T)
+ if(first == T && !isblanksym(t1->sym))
first = t1;
continue;
}
@@ -2901,7 +2901,7 @@ geneq(Sym *sym, Type *t)
first = T;
for(t1=t->type;; t1=t1->down) {
if(t1 != T && (isblanksym(t1->sym) || algtype1(t1->type, nil) == AMEM)) {
- if(first == T)
+ if(first == T && !isblanksym(t1->sym))
first = t1;
continue;
}