]> Cypherpunks repositories - gostls13.git/commitdiff
goyacc: fix indexing bug when yydebug >= 2
authorRob Pike <r@golang.org>
Fri, 20 Jan 2012 18:22:41 +0000 (10:22 -0800)
committerRob Pike <r@golang.org>
Fri, 20 Jan 2012 18:22:41 +0000 (10:22 -0800)
Fixes #2701.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5556070

src/cmd/goyacc/goyacc.go

index ff18fa7e701b9aabd398ed6b4dc01a124d1d6b09..e1b99bed2bd41b26cf0ac5c713341a373f59d95a 100644 (file)
@@ -3271,10 +3271,9 @@ $$default:
                                        }
                                }
 
-                               /* the current p has no shift onn "error", pop stack */
+                               /* the current p has no shift on "error", pop stack */
                                if $$Debug >= 2 {
-                                       fmt.Printf("error recovery pops state %d, uncovers %d\n",
-                                               $$S[$$p].yys, $$S[$$p-1].yys)
+                                       fmt.Printf("error recovery pops state %d\n", $$S[$$p].yys)
                                }
                                $$p--
                        }