Skip to content

bpo-37188: Fix a divide-by-zero in arrays of size-0 objects#13881

Merged
skrah merged 1 commit into
python:masterfrom
eric-wieser:bpo37188
Jun 7, 2019
Merged

bpo-37188: Fix a divide-by-zero in arrays of size-0 objects#13881
skrah merged 1 commit into
python:masterfrom
eric-wieser:bpo37188

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

itemsize can be zero when _type_ is an empty struct or length-0 array.

This line used to be length * itemsize < 0, which didn't exhibit this problem.

https://bugs.python.org/issue37188

`itemsize` can be zero when `_type_` is an empty struct or length-0 array.

This line used to be `length * itemsize < 0`, which didn't exhibit this problem.
@eric-wieser

Copy link
Copy Markdown
Contributor Author

@skrah, mind taking a look since this blocks #5576?

@bedevere-bot

Copy link
Copy Markdown

@skrah: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @eric-wieser and @skrah, I had trouble checking out the 2.7 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 0690c79c419b8d2bdfe7c5b6dca57b018f5a5a54 2.7

@bedevere-bot

Copy link
Copy Markdown

GH-13882 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 7, 2019
…-13881)

(cherry picked from commit 0690c79)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@skrah

skrah commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

@eric-wieser Thanks for catching this! This appears to have been backported to 2.7 and the auto-backport fails. Do you have time to do a manual backport PR?

@skrah

skrah commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

Actually I missed assert sizeof(obj) == 0, which should use self.assertEqual(). I can change that in a follow-up.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @eric-wieser and @skrah, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0690c79c419b8d2bdfe7c5b6dca57b018f5a5a54 2.7

@bedevere-bot

Copy link
Copy Markdown

GH-13906 is a backport of this pull request to the 2.7 branch.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @eric-wieser for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-13911 is a backport of this pull request to the 3.8 branch.

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants