diff options
| author | Ćukasz Langa <lukasz@langa.pl> | 2021-10-20 16:51:13 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-20 16:51:13 (GMT) |
| commit | 88f4ec88e282bf861f0af2d237e9fe28fbc8deac (patch) | |
| tree | 289d8b70bca2eee134958dfe5b6311c9f3ccf474 /Python | |
| parent | 50e8b2ff0273e81829ed3fa4ab9ef9898fd2b891 (diff) | |
| download | cpython-88f4ec88e282bf861f0af2d237e9fe28fbc8deac.zip cpython-88f4ec88e282bf861f0af2d237e9fe28fbc8deac.tar.gz cpython-88f4ec88e282bf861f0af2d237e9fe28fbc8deac.tar.bz2 | |
[3.9] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (#29071)
There are two errors that this commit fixes:
* The parser was not correctly computing the offset and the string
source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
exception happened in rules involving optionals ('?', [...]) as we
always make them return valid results by using the comma operator. We
need to check first if we don't have an error before continuing..
(cherry picked from commit a106343f632a99c8ebb0136fa140cf189b4a6a57)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
NOTE: unlike the cherry-picked original, this commit points at a crazy location
due to a bug in the tokenizer that required a big refactor in 3.10 to fix.
We are leaving as-is for 3.9.
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions
