[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Eric V. Smith

Eric V. Smith added the comment:

Your patch looks like the output of hg help, or similar.

--
nosy: +eric.smith

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


Removed file: http://bugs.python.org/file30989/frombaseobj.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Christian Heimes

Christian Heimes added the comment:

Oh, you are right ...

The patch is trivial: I switched the Py_DECREF() and return NULL lines.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Eric V. Smith

Eric V. Smith added the comment:

For some reason the blank link in the Coverity report confused me. Yes, 
swapping the lines looks right.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 25ffad2e12d6 by Christian Heimes in branch '3.3':
Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
http://hg.python.org/cpython/rev/25ffad2e12d6

New changeset afe119a3619f by Christian Heimes in branch 'default':
Issue #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
http://hg.python.org/cpython/rev/afe119a3619f

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-21 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for the review

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-20 Thread Christian Heimes

New submission from Christian Heimes:

http://hg.python.org/cpython/file/a65856044ad4/Modules/_ctypes/_ctypes.c#l2673

Coverity analysis:

2672} else { /* copy contents of adr */
2673if (-1 == PyCData_MallocBuffer(cmem, dict)) {
2674return NULL;

CID 715381: Structurally dead code (UNREACHABLE)unreachable: This code cannot 
be reached: do {
PyObject *_py_decref
2675Py_DECREF(cmem);
2676}

--
components: Extension Modules
files: frombaseobj.patch
keywords: patch
messages: 193406
nosy: christian.heimes
priority: low
severity: normal
stage: needs patch
status: open
title: Unreachable  Py_DECREF() in ctypes's PyCData_FromBaseObj()
type: resource usage
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30989/frombaseobj.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18514
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com