BUG: check for errors after PyArray_DESCR_REPLACE#12546
Merged
seberg merged 1 commit intonumpy:masterfrom Dec 17, 2018
Merged
Conversation
Member
|
Looks good to me, is there an easy way to test these? |
eric-wieser
reviewed
Dec 17, 2018
Member
There was a problem hiding this comment.
This should be goto error, not goto fail.
As is, it silences the MemoryError that might occur here, and tries to replace it with another exception
Member
There was a problem hiding this comment.
Or perhaps even just return NPY_FAIL
eric-wieser
reviewed
Dec 17, 2018
Member
There was a problem hiding this comment.
error here too (or return NPY_FAIL)
0b4e6fa to
d5200bd
Compare
Member
Author
Not really. We could consider a flag that prevents memory allocation that could be turned on randomly in testing. |
Member
|
Should have realized it was memory allocation errors. Thanks both of you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PyArray_DESCR_REPLACE(descr)is a macro that callsPyArray_DescrNew. SincePyArray_DescrNewcan error, we must check the return value.Refactored out of #12430