Skip to content

Commit 916c981

Browse files
pcaspersjenkins
authored andcommitted
QPR-11984 fixes, avoid invalid loads of bools
1 parent e8c9363 commit 916c981

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

QuantExt/qle/math/randomvariable.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace QuantExt {
3030

3131
Filter::~Filter() { clear(); }
3232

33-
Filter::Filter() : n_(0), data_(nullptr), deterministic_(false) {}
33+
Filter::Filter() : n_(0), constantData_(false), data_(nullptr), deterministic_(false) {}
3434

3535
Filter::Filter(const Filter& r) {
3636
n_ = r.n_;
@@ -92,7 +92,7 @@ Filter& Filter::operator=(Filter&& r) {
9292
return *this;
9393
}
9494

95-
Filter::Filter(const Size n, const bool value) : n_(n), constantData_(value), deterministic_(true) {}
95+
Filter::Filter(const Size n, const bool value) : n_(n), constantData_(value), data_(nullptr), deterministic_(true) {}
9696

9797
void Filter::clear() {
9898
n_ = 0;
@@ -244,7 +244,8 @@ Filter operator!(Filter x) {
244244

245245
RandomVariable::~RandomVariable() { clear(); }
246246

247-
RandomVariable::RandomVariable() : n_(0), data_(nullptr), deterministic_(false), time_(Null<Real>()) {}
247+
RandomVariable::RandomVariable()
248+
: n_(0), constantData_(0.0), data_(nullptr), deterministic_(false), time_(Null<Real>()) {}
248249

249250
RandomVariable::RandomVariable(const RandomVariable& r) {
250251
n_ = r.n_;

0 commit comments

Comments
 (0)