summaryrefslogtreecommitdiffstats
path: root/Parser/pegen
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-05-04 00:20:09 (GMT)
committerGitHub <noreply@github.com>2020-05-04 00:20:09 (GMT)
commit7f06af684a1882fdb19d20650825948b1d7996e5 (patch)
tree6106d2c0d2aef7ca76ac522f313a9f54006e97bf /Parser/pegen
parentad9eaeab74b680830dbefc18e8fe3dec4677a21b (diff)
downloadcpython-7f06af684a1882fdb19d20650825948b1d7996e5.zip
cpython-7f06af684a1882fdb19d20650825948b1d7996e5.tar.gz
cpython-7f06af684a1882fdb19d20650825948b1d7996e5.tar.bz2
bpo-40334: Set error_indicator in _PyPegen_raise_error (GH-19887)
Due to PyErr_Occurred not being called at the beginning of each rule, we need to set the error indicator, so that rules do not get expanded after an exception has been thrown
Diffstat (limited to 'Parser/pegen')
-rw-r--r--Parser/pegen/pegen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c
index 6ff09b3..9858f71 100644
--- a/Parser/pegen/pegen.c
+++ b/Parser/pegen/pegen.c
@@ -389,6 +389,7 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, int with_col_number, const ch
Token *t = p->tokens[p->fill - 1];
Py_ssize_t col_number = !with_col_number;
va_list va;
+ p->error_indicator = 1;
va_start(va, errmsg);
errstr = PyUnicode_FromFormatV(errmsg, va);