Skip to content

Commit ed4776b

Browse files
WanzenBugstefanseefeld
authored andcommitted
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.
1 parent ac62db1 commit ed4776b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/numpy/numpy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static void wrap_import_array()
1919
static void * wrap_import_array()
2020
{
2121
import_array();
22+
return NULL;
2223
}
2324
#endif
2425

0 commit comments

Comments
 (0)