[Numpy-svn] [numpy/numpy] b343f4: BUG: Incref items in np.take on error as they are ...

GitHub noreply@github....
Sun Feb 24 20:00:18 CST 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: b343f43eea856bd984a752f288bd148a42a789a1
      https://github.com/numpy/numpy/commit/b343f43eea856bd984a752f288bd148a42a789a1
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-02-24 (Sun, 24 Feb 2013)

  Changed paths:
    M numpy/core/src/multiarray/item_selection.c
    M numpy/core/tests/test_item_selection.py
    M numpy/core/tests/test_regression.py

  Log Message:
  -----------
  BUG: Incref items in np.take on error as they are decrefed later

When take fails during copying due to out of bound indices, then the already
copied items will be decref'd on array destruction. To avoid that, as well
as possible overlapping or already initialized object arrays, decref and
incref during the copy operation itself. Note that all basic types but
object use their own fasttake, so this does not change anything for them.


  Commit: 58548e66d5d3bda3e884ae0c0ab0805ab0160484
      https://github.com/numpy/numpy/commit/58548e66d5d3bda3e884ae0c0ab0805ab0160484
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-02-24 (Sun, 24 Feb 2013)

  Changed paths:
    M numpy/core/tests/test_item_selection.py

  Log Message:
  -----------
  TST: Add test for np.take refcounting

Also make the testcase for take a class.


  Commit: 230ee3aa201552a8a9fa13c4b319f68cbd504d85
      https://github.com/numpy/numpy/commit/230ee3aa201552a8a9fa13c4b319f68cbd504d85
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-02-24 (Sun, 24 Feb 2013)

  Changed paths:
    M numpy/core/src/multiarray/item_selection.c
    M numpy/core/tests/test_indexerrors.py

  Log Message:
  -----------
  BUG: non-empty takes on empty axes failed for clip/wrap logic

These did no checking for this special case. And thus, wrap would go
into infinite loops trying to adjust the index, and clip would (probably)
segfault. This raises IndexError explicitely beforehand.


  Commit: 6de7a4be70c894e3d63ac952bd20a74c171e6413
      https://github.com/numpy/numpy/commit/6de7a4be70c894e3d63ac952bd20a74c171e6413
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-02-24 (Sun, 24 Feb 2013)

  Changed paths:
    M numpy/core/src/multiarray/item_selection.c
    M numpy/core/tests/test_indexerrors.py
    M numpy/core/tests/test_item_selection.py
    M numpy/core/tests/test_regression.py

  Log Message:
  -----------
  Merge pull request #3002 from seberg/issue-3001

BUG: Incref items in np.take on error as they are decrefed later


Compare: https://github.com/numpy/numpy/compare/17774a6d58b8...6de7a4be70c8


More information about the Numpy-svn mailing list