-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-40661: Fix segfaults when parsing invalid input #20159
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
Conversation
Fixes bpo-40661. (In fact this just is the patch from @pablogsal from that issue.) Note that for an extreme benchmark (xxl.py) this caused a 40% slowdown on my Mac. However for an "average" benchmark (stdlib) there was no significant difference.
|
self.print("if (p->error_indicator == 1 || PyErr_Occurred()) {") | ||
with self.indent(): | ||
self.print("p->error_indicator = 1;") | ||
self.print("return NULL;") | ||
self.print("}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually move this within the scope block of the alternative (after the with self.indent()
below).
Lysandros, can you take over responsibility for this PR? I'm just out of
energy for this.
|
Yes, of course! Should we close it and open a new one, since I can't push to a branch of the upstream repo? |
Sure.
|
Ok, closing. |
To follow up: I believe this may have been an exaggerated outcome because I built with debug flags on (and had forgotten about it). |
Fixes bpo-40661. (In fact this just is the patch from @pablogsal from
that issue.)
Note that for an extreme benchmark (xxl.py) this caused a 40% slowdown
on my Mac. However for an "average" benchmark (stdlib) there was no
significant difference.
https://bugs.python.org/issue40661