[3.10] Ensure the str member of the tokenizer is always initialised (GH-29681). (GH-29683)

(cherry picked from commit 4f006a789a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
Pablo Galindo Salgado 2021-11-21 04:15:22 +00:00 committed by GitHub
parent 9841ac2da5
commit 07cf66fd03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 428 additions and 3 deletions

View file

@ -71,7 +71,7 @@ struct tok_state {
PyObject *decoding_readline; /* open(...).readline */
PyObject *decoding_buffer;
const char* enc; /* Encoding for the current str. */
char* str;
char* str; /* Source string being tokenized (if tokenizing from a string)*/
char* input; /* Tokenizer's newline translated copy of the string. */
int type_comments; /* Whether to look for type comments */