cpython/Parser/pegen
Łukasz Langa 88f4ec88e2
[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 a106343f63)

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.
2021-10-20 18:51:13 +02:00
..
parse.c [3.9] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (#29071) 2021-10-20 18:51:13 +02:00
parse_string.c [3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) (GH-28945) 2021-10-14 20:03:29 +03:00
parse_string.h bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962) 2020-05-07 11:37:51 +01:00
peg_api.c bpo-40334: Make the PyPegen* and PyParser* APIs more consistent (GH-19839) 2020-05-01 18:30:51 +01:00
pegen.c [3.9] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (#29071) 2021-10-20 18:51:13 +02:00
pegen.h bpo-43555: Report the column offset for invalid line continuation character (GH-24939) (#24975) 2021-03-22 19:07:05 +00:00