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

GitHub noreply@github....
Sat Dec 15 21:30:10 CST 2012


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 3c23c9f6f50b5bea5f449cddd607d5758e4b45b1
      https://github.com/numpy/numpy/commit/3c23c9f6f50b5bea5f449cddd607d5758e4b45b1
  Author: Ondřej Čertík <ondrej.certik@gmail.com>
  Date:   2012-12-15 (Sat, 15 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: afde23f1897812570f176227fb1d32245c28bb3c
      https://github.com/numpy/numpy/commit/afde23f1897812570f176227fb1d32245c28bb3c
  Author: Travis E. Oliphant <teoliphant@gmail.com>
  Date:   2012-12-15 (Sat, 15 Dec 2012)

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

  Log Message:
  -----------
  Merge pull request #2831 from certik/fix2738

FIX: Fixes the segfault in PyArray_FromScalar


Compare: https://github.com/numpy/numpy/compare/5f04dc8a5334...afde23f18978


More information about the Numpy-svn mailing list