aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2019-06-11 22:09:56 +0200
committerWenzel Jakob <wenzel.jakob@epfl.ch>2019-06-11 23:28:58 +0200
commit38f408fccd358e4322238f5aada3b3af22f5f388 (patch)
treeb7d6261f89248d6ab5cae9801e678c225a7f9dc1 /include
parent868d94fcb4769ad3a5d826c9f5483376433da8a5 (diff)
downloadplatform_external_python_pybind11-38f408fccd358e4322238f5aada3b3af22f5f388.tar.gz
platform_external_python_pybind11-38f408fccd358e4322238f5aada3b3af22f5f388.tar.bz2
platform_external_python_pybind11-38f408fccd358e4322238f5aada3b3af22f5f388.zip
value_and_holder: uninit members (#1660)
fix some uninitialized members in `value_and_holder` for some of the constructurs. Found with coverity in a downstream project.
Diffstat (limited to 'include')
-rw-r--r--include/pybind11/cast.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h
index 80abb2b..8d0fd5d 100644
--- a/include/pybind11/cast.h
+++ b/include/pybind11/cast.h
@@ -204,10 +204,10 @@ PYBIND11_NOINLINE inline handle get_type_handle(const std::type_info &tp, bool t
}
struct value_and_holder {
- instance *inst;
- size_t index;
- const detail::type_info *type;
- void **vh;
+ instance *inst = nullptr;
+ size_t index = 0u;
+ const detail::type_info *type = nullptr;
+ void **vh = nullptr;
// Main constructor for a found value/holder:
value_and_holder(instance *i, const detail::type_info *type, size_t vpos, size_t index) :
@@ -216,7 +216,7 @@ struct value_and_holder {
{}
// Default constructor (used to signal a value-and-holder not found by get_value_and_holder())
- value_and_holder() : inst{nullptr} {}
+ value_and_holder() {}
// Used for past-the-end iterator
value_and_holder(size_t index) : index{index} {}
@@ -270,8 +270,8 @@ public:
struct iterator {
private:
- instance *inst;
- const type_vec *types;
+ instance *inst = nullptr;
+ const type_vec *types = nullptr;
value_and_holder curr;
friend struct values_and_holders;
iterator(instance *inst, const type_vec *tinfo)