diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-10-19 19:24:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 19:24:12 (GMT) |
commit | a106343f632a99c8ebb0136fa140cf189b4a6a57 (patch) | |
tree | ff125fecd7da936de3a41375ecdcf5e30ec09b4a /Misc | |
parent | bda69abe849b37467350d3750ae24d356230c940 (diff) | |
download | cpython-a106343f632a99c8ebb0136fa140cf189b4a6a57.zip cpython-a106343f632a99c8ebb0136fa140cf189b4a6a57.tar.gz cpython-a106343f632a99c8ebb0136fa140cf189b4a6a57.tar.bz2 |
bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993)
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2021-10-16-17-27-48.bpo-45494.vMt1g4.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-10-16-17-27-48.bpo-45494.vMt1g4.rst b/Misc/NEWS.d/next/Core and Builtins/2021-10-16-17-27-48.bpo-45494.vMt1g4.rst new file mode 100644 index 0000000..97e2981 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-10-16-17-27-48.bpo-45494.vMt1g4.rst @@ -0,0 +1,2 @@ +Fix parser crash when reporting errors involving invalid continuation +characters. Patch by Pablo Galindo. |