diff options
-rw-r--r-- | Parser/grammar1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/grammar1.c b/Parser/grammar1.c index 1f7d264..17e2ba9 100644 --- a/Parser/grammar1.c +++ b/Parser/grammar1.c @@ -45,7 +45,7 @@ PyGrammar_LabelRepr(label *lb) else return lb->lb_str; } - else { + else if (lb->lb_type < N_TOKENS) { if (lb->lb_str == NULL) return _PyParser_TokenNames[lb->lb_type]; else { @@ -54,4 +54,7 @@ PyGrammar_LabelRepr(label *lb) return buf; } } + else { + Py_FatalError("invalid label"); + } } |