GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-40334: Improvements to error-handling code in the PEG parser by lysnikolaou · Pull Request #20003 · python/cpython

Conversation

@lysnikolaou

@lysnikolaou lysnikolaou commented May 8, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Following improvements are implemented in this PR:

  • p->error_indicator is set, in case malloc or realloc fail
  • Avoid memory leaks in the case that realloc fails
  • Call PyErr_NoMemory() instead of PyErr_Format(), because it
    requires no memory

https://bugs.python.org/issue40334

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lysnikolaou
bpo-40334: Improvements to error-handling code in the PEG parser
d926d4f
Following improvements are implemented in this PR:
- `p->error_indicator` is set, in case malloc or realloc fail
- Avoid memory leaks in the case that realloc fails
- Call `PyErr_NoMemory()` instead of `PyErr_Format()`, because it
  requires no memory.
@lysnikolaou
lysnikolaou requested a review from pablogsal as a code owner May 8, 2020 15:08
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 8, 2020
@bedevere-bot bedevere-bot added the awaiting review label May 8, 2020
@lysnikolaou
lysnikolaou requested a review from gvanrossum May 8, 2020 15:09
@lysnikolaou lysnikolaou added the skip news label May 8, 2020
@lysnikolaou

lysnikolaou commented May 8, 2020

Copy link
Copy Markdown
Member Author

Note to self: This partially conflicts with #19987, so will probably need to merge master after that's landed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou
Merge branch 'master' into error-improvements
540b818
@lysnikolaou
lysnikolaou requested review from gvanrossum and pablogsal and removed request for gvanrossum and pablogsal May 11, 2020 15:22
@pablogsal

pablogsal commented May 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • p->error_indicator is set, in case malloc or realloc fail

Do we need to do this? As soon as the rule returns it will go immediately to a if (_res == NULL && PyErr_Occurred()) block, no?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou

lysnikolaou commented May 11, 2020

Copy link
Copy Markdown
Member Author
  • p->error_indicator is set, in case malloc or realloc fail

Do we need to do this? As soon as the rule returns it will go immediately to a if (_res == NULL && PyErr_Occurred()) block, no?

I can't really see this, how exactly is this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented May 11, 2020

Copy link
Copy Markdown
Member

I can't really see this, how exactly is this?

I have checked again and this only happens when the rule does not return NULL, so forget what I said :(

lysnikolaou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou
Merge branch 'master' into error-improvements
c840fca
@lysnikolaou

lysnikolaou commented May 17, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Resolved the conflicts so that we can hopefully merge this and close bpo-40334.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed May 17, 2020
View reviewed changes
Comment thread Tools/peg_generator/pegen/c_generator.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou @pablogsal
Remove unnecessary else clause in generated code
c90c702
Co-authored-by: Pablo Galindo <[email protected]>
@pablogsal

pablogsal commented May 17, 2020

Copy link
Copy Markdown
Member

@lysnikolaou You need to regenerate the parser 😉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou
Regenerate parse.c
75335ff
@lysnikolaou

lysnikolaou commented May 17, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@lysnikolaou You need to regenerate the parser 😉

Done! Sorry, it's getting late..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented May 17, 2020

Copy link
Copy Markdown
Member

Done! Sorry, it's getting late..

No problem. I want to land this and the other PR so they both make it to beta 1 which is next Monday :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal
pablogsal merged commit 2c8cd06 into python:master May 17, 2020
@bedevere-bot bedevere-bot removed the awaiting review label May 17, 2020
@pablogsal pablogsal mentioned this pull request May 17, 2020
bpo-40334: Produce better error messages on invalid targets #20106
Merged
arturoescaip pushed a commit to arturoescaip/cpython that referenced this pull request May 24, 2020
@lysnikolaou @pablogsal @arturoescaip
bpo-40334: Improvements to error-handling code in the PEG parser (pyt…
f79489e
…honGH-20003)

The following improvements are implemented in this commit:
- `p->error_indicator` is set, in case malloc or realloc fail.
- Avoid memory leaks in the case that realloc fails.
- Call `PyErr_NoMemory()` instead of `PyErr_Format()`, because it requires no memory.

Co-authored-by: Pablo Galindo <[email protected]>
@lysnikolaou
lysnikolaou deleted the error-improvements branch May 27, 2020 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal left review comments
@gvanrossum gvanrossum Awaiting requested review from gvanrossum

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@lysnikolaou @pablogsal @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.