[Numpy-svn] [numpy/numpy] e208de: FIX: Fixes the segfault in PyArray_FromScalar

GitHub noreply@github....
Sun Dec 16 13:59:39 CST 2012


  Branch: refs/heads/maintenance/1.7.x
  Home:   https://github.com/numpy/numpy
  Commit: e208de6adfdd38aabe0b5a87ba22f80e04a014ad
      https://github.com/numpy/numpy/commit/e208de6adfdd38aabe0b5a87ba22f80e04a014ad
  Author: Ondřej Čertík <ondrej.certik@gmail.com>
  Date:   2012-12-16 (Sun, 16 Dec 2012)

  Changed paths:
    M numpy/core/src/multiarray/scalarapi.c

  Log Message:
  -----------
  FIX: Fixes the segfault in PyArray_FromScalar

The problem was that PyArray_NewFromDescr() steals a reference to typecode and
so any further usage of it is undefined. Apparently this bug only appeared in
debug version of Python 3.2. The fix is to simply INCREF typecode and then
carefully DECREF it at each possible exit from the function.

Fixes gh-2738.


  Commit: d5d7632870a535051d18ca23e6f9c7d6e4828aee
      https://github.com/numpy/numpy/commit/d5d7632870a535051d18ca23e6f9c7d6e4828aee
  Author: Ondřej Čertík <ondrej.certik@gmail.com>
  Date:   2012-12-16 (Sun, 16 Dec 2012)

  Changed paths:
    M numpy/core/src/multiarray/scalarapi.c

  Log Message:
  -----------
  Merge pull request #2837 from certik/backport2831

FIX: Fixes the segfault in PyArray_FromScalar


Compare: https://github.com/numpy/numpy/compare/7bdeaa3f0509...d5d7632870a5


More information about the Numpy-svn mailing list