FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: fix integer size confusion in handling array's ndmin argument by charris · Pull Request #14937 · numpy/numpy · GitHub

/ numpy Public

BUG: fix integer size confusion in handling array's ndmin argument - #14937

Merged
charris merged 1 commit into
numpy:maintenance/1.17.xfrom
charris:backport-14769
Nov 19, 2019
Merged

charris merged 1 commit into
numpy:maintenance/1.17.xfrom
charris:backport-14769

Conversation

charris commented Nov 19, 2019
edited
Loading

Copy link
Copy Markdown
Member

Backport of #14769.

The ndmin local variable was changed from an "int" to an "npy_intp" but
&ndmin is passed to PyArg_ParseTupleAndKeywords against a "i" argument
spec, but these integers have different sizes (well on an LP64 platform
anyway). This actually works on a little endian system but fails
on a big endian one. Fix this by converting the local back to an int,
and being a little careful before assigning the result of PyLong_AsLong to
it.

Fixes #14767

The ndmin local variable was changed from an "int" to an "npy_intp" but
&ndmin is passed to PyArg_ParseTupleAndKeywords against a "i" argument
spec, but these integers have different sizes (well on an LP64 platform
anyway). This actually works on a little endian system but fails
on a big endian one. Fix this by converting the local back to an int,
and being a little careful before assigning the result of PyLong_AsLong to
it.

Fixes numpy#14767
charris added this to the 1.17.5 release milestone Nov 19, 2019
charris merged commit fe46f17 into numpy:maintenance/1.17.x Nov 19, 2019
charris deleted the backport-14769 branch November 19, 2019 19:18
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL