mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Ensure the str member of the tokenizer is always initialised (GH-29681)
This commit is contained in:
parent
4cf65240ae
commit
4f006a789a
3 changed files with 3 additions and 3 deletions
|
|
@ -245,7 +245,7 @@ get_error_line_from_tokenizer_buffers(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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue