Skip to content

Commit

Permalink
No, I don't have an uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Jan 22, 2021
1 parent cffc586 commit 8356073
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1044,17 +1044,12 @@ struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_t
return false;
} else {
handle src_or_index = src;
py_value = (py_type) -1;
#if PY_VERSION_HEX < 0x03080000
object index;
if (index_check(src.ptr())) {
if (!PYBIND11_LONG_CHECK(src.ptr()) && index_check(src.ptr())) {
index = reinterpret_steal<object>(PyNumber_Index(src.ptr()));
if (!index) {
src_or_index = handle();
py_value = (py_type) -1;
}
else {
src_or_index = index;
}
src_or_index = index ? index : handle();
}
#endif
if (src_or_index) {
Expand Down

0 comments on commit 8356073

Please sign in to comment.