diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-11-21 04:15:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 04:15:22 (GMT) |
commit | 07cf66fd03e161c09279346da4e76705cf42d535 (patch) | |
tree | b93db952fce0d3d9777b847a519094e99bfbcfc8 /Parser/pegen.c | |
parent | 9841ac2da5689ff765250c1abdbf5af9d3750519 (diff) | |
download | cpython-07cf66fd03e161c09279346da4e76705cf42d535.zip cpython-07cf66fd03e161c09279346da4e76705cf42d535.tar.gz cpython-07cf66fd03e161c09279346da4e76705cf42d535.tar.bz2 |
[3.10] Ensure the str member of the tokenizer is always initialised (GH-29681). (GH-29683)
(cherry picked from commit 4f006a789a35f5d1a7ef142bd1304ce167392457)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r-- | Parser/pegen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c index 464a902..8946aa3 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -432,7 +432,7 @@ get_error_line(Parser *p, Py_ssize_t lineno) * (multi-line) statement are stored in p->tok->interactive_src_start. * If not, we're parsing from a string, which means that the whole source * is stored in p->tok->str. */ - assert(p->tok->fp == NULL || p->tok->fp == stdin); + assert((p->tok->fp == NULL && p->tok->str != NULL) || p->tok->fp == stdin); char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str; assert(cur_line != NULL); |