Skip to content

[3.10] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) #29070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Oct 19, 2021

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 a106343)

Co-authored-by: Pablo Galindo Salgado [email protected]

https://bugs.python.org/issue45494

…valid continuation characters (pythonGH-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..
(cherry picked from commit a106343)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants