]> Cypherpunks repositories - gostls13.git/commit
gc: fix label recursion bugs
authorRuss Cox <rsc@golang.org>
Thu, 1 Sep 2011 17:44:46 +0000 (13:44 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 1 Sep 2011 17:44:46 +0000 (13:44 -0400)
commit60d47101aa3815ff0f8fdcd9369e6f3664ce1a70
tree2663cb42e58de9a004f81a524d7cb5e49da19aa7
parentae502c4e02c3728aed9553279c7c787ae3ec39a3
gc: fix label recursion bugs

Was keeping a pointer to the labeled statement in n->right,
which meant that generic traversals of the tree visited it twice.
That combined with aggressive flattening of the block
structure when possible during parsing meant that
the kinds of label: code label: code label: code sequences
generated by yacc were giving the recursion 2ⁿ paths
through the program.

Fixes #2212.

R=lvd
CC=golang-dev
https://golang.org/cl/4960050
src/cmd/gc/gen.c
src/cmd/gc/go.h
src/cmd/gc/go.y
src/cmd/gc/subr.c
test/escape2.go