This adds a missing return statement in the python3 specific
import logic of boost.python.numpy.
For python3 wrap_import_array() needs to return a pointer value.
The import_array() macro only returns NULL in case of error. The
missing return statement is UB, so the compiler can assume it does
not happen. This means the compiler can assume the error branch
is always taken, so import_array must always fail.
This example depends on the behaviour of ```__metaclass__```. This has
changed in python 3, and the example no longer works. Removing example
code as suggested, see #210 for more details and possible alternatives.
Closes#210.
Line no 138-139 suggest if condition satisfy if n_actual <=max_arity :
if (n_actual + f->m_nkeyword_values >= min_arity
&& n_actual <= max_arity)
So condition at Line no 161 is not reachable.
Python 3.7 changes the return type of _PyUnicode_AsString()
from void* to const char* -- causing the build of boost-python
to fail.
Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
Unfortunately due to optimised build of Python3 libraries and executable I got only partial stack from [http://clang.llvm.org/docs/AddressSanitizer.html], however digging into and reducing my code I tracked it down to be issue with `boost/libs/python/src/object/enum.cpp`.
It has to bits that leak (and comment mentioning there is one):
PyObject *mod = PyObject_GetAttrString( self_, "__module__");
Leaks reference, as it never decreases it.
It also stores a new string object under object's `name` that ref count never gets decremented.
That commit fixes both issues.
This was properly an oversight when switching to the BOOST_SYMBOL_*
symbols from Boost.Config in commit 0224f54a (see #1)
Since Boost.Config is already doing the differentiation between
different platforms and compilers we can simplify this bit and just
use BOOST_SYMBOL_EXPORT