Commit b31ec5c5 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/yacc: error rather than panic when TEMPSIZE is too small

I tried simply increasing the size of the slice but then I got an error
because NSTATES was too small. Leaving a real fix for after 1.7.

Update #16144.

Change-Id: I8676772cb79845dd4ca1619977d4d54a2ce6de59
Reviewed-on: https://go-review.googlesource.com/24321
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
parent 0dae2fd1
......@@ -683,6 +683,10 @@ outer:
levprd[nprod] = 0
}
if TEMPSIZE < ntokens+nnonter+1 {
errorf("too many tokens (%d) or non-terminals (%d)", ntokens, nnonter)
}
//
// end of all rules
// dump out the prefix code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment