2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 16:32:16 +00:00

Add missing return statement in numpy import

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 commit is contained in:
Moritz Wanzenböck
2018-07-11 11:57:46 +02:00
committed by Stefan Seefeld
parent ac62db1cf1
commit ed4776b59c

View File

@@ -19,6 +19,7 @@ static void wrap_import_array()
static void * wrap_import_array()
{
import_array();
return NULL;
}
#endif