From adc5c8d1c1347ef5e2ced4d9aa0afa6e9e594457 Mon Sep 17 00:00:00 2001 From: TimQu Date: Sun, 13 Sep 2015 16:31:38 +0200 Subject: [PATCH 1/2] Fixed another memory leak: CheckResults have not been destructed properly. Former-commit-id: 5631c101bbbd3cf3e6e69d87a6fab71c927fd5a8 --- src/modelchecker/results/CheckResult.h | 2 ++ src/modelchecker/results/ExplicitQualitativeCheckResult.h | 1 + src/modelchecker/results/ExplicitQuantitativeCheckResult.h | 1 + src/modelchecker/results/QualitativeCheckResult.h | 1 + src/modelchecker/results/QuantitativeCheckResult.h | 3 +++ 5 files changed, 8 insertions(+) diff --git a/src/modelchecker/results/CheckResult.h b/src/modelchecker/results/CheckResult.h index 93ff1399f..1de7a33c5 100644 --- a/src/modelchecker/results/CheckResult.h +++ b/src/modelchecker/results/CheckResult.h @@ -21,6 +21,8 @@ namespace storm { // The base class of all check results. class CheckResult { public: + virtual ~CheckResult() = default; + /*! * Filters the current result wrt. to the filter, i.e. only keeps the entries that are selected by the filter. * This means that the filter must be a qualitative result of proper type (symbolic/explicit). diff --git a/src/modelchecker/results/ExplicitQualitativeCheckResult.h b/src/modelchecker/results/ExplicitQualitativeCheckResult.h index abce327b4..665675cfd 100644 --- a/src/modelchecker/results/ExplicitQualitativeCheckResult.h +++ b/src/modelchecker/results/ExplicitQualitativeCheckResult.h @@ -18,6 +18,7 @@ namespace storm { typedef std::map map_type; ExplicitQualitativeCheckResult(); + virtual ~ExplicitQualitativeCheckResult() = default; ExplicitQualitativeCheckResult(map_type const& map); ExplicitQualitativeCheckResult(map_type&& map); ExplicitQualitativeCheckResult(storm::storage::sparse::state_type state, bool value); diff --git a/src/modelchecker/results/ExplicitQuantitativeCheckResult.h b/src/modelchecker/results/ExplicitQuantitativeCheckResult.h index 07166d258..542abe059 100644 --- a/src/modelchecker/results/ExplicitQuantitativeCheckResult.h +++ b/src/modelchecker/results/ExplicitQuantitativeCheckResult.h @@ -30,6 +30,7 @@ namespace storm { ExplicitQuantitativeCheckResult(ExplicitQuantitativeCheckResult&& other) = default; ExplicitQuantitativeCheckResult& operator=(ExplicitQuantitativeCheckResult&& other) = default; #endif + virtual ~ExplicitQuantitativeCheckResult() = default; ValueType& operator[](storm::storage::sparse::state_type state); ValueType const& operator[](storm::storage::sparse::state_type state) const; diff --git a/src/modelchecker/results/QualitativeCheckResult.h b/src/modelchecker/results/QualitativeCheckResult.h index 5904d2b6e..608e2c0d1 100644 --- a/src/modelchecker/results/QualitativeCheckResult.h +++ b/src/modelchecker/results/QualitativeCheckResult.h @@ -7,6 +7,7 @@ namespace storm { namespace modelchecker { class QualitativeCheckResult : public CheckResult { public: + virtual ~QualitativeCheckResult() = default; virtual QualitativeCheckResult& operator&=(QualitativeCheckResult const& other); virtual QualitativeCheckResult& operator|=(QualitativeCheckResult const& other); virtual void complement(); diff --git a/src/modelchecker/results/QuantitativeCheckResult.h b/src/modelchecker/results/QuantitativeCheckResult.h index 2dc1afc39..425e7b6ef 100644 --- a/src/modelchecker/results/QuantitativeCheckResult.h +++ b/src/modelchecker/results/QuantitativeCheckResult.h @@ -7,6 +7,9 @@ namespace storm { namespace modelchecker { class QuantitativeCheckResult : public CheckResult { public: + + virtual ~QuantitativeCheckResult() = default; + virtual std::unique_ptr compareAgainstBound(storm::logic::ComparisonType comparisonType, double bound) const; virtual bool isQuantitative() const override; From deec423f2795807d1033797bd07ada2f96737710 Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 15 Sep 2015 14:21:34 +0200 Subject: [PATCH 2/2] fixed infinite recursion in constants comparator Former-commit-id: b36b352d3690110f6795ac2ef7edfb7a24467bd4 --- src/utility/ConstantsComparator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utility/ConstantsComparator.cpp b/src/utility/ConstantsComparator.cpp index aecfa39fb..afeef6616 100644 --- a/src/utility/ConstantsComparator.cpp +++ b/src/utility/ConstantsComparator.cpp @@ -11,12 +11,12 @@ namespace storm { namespace utility { template bool ConstantsComparator::isOne(ValueType const& value) const { - return isOne(value); + return storm::utility::isOne(value); } template bool ConstantsComparator::isZero(ValueType const& value) const { - return isZero(value); + return storm::utility::isZero(value); } template @@ -26,7 +26,7 @@ namespace storm { template bool ConstantsComparator::isConstant(ValueType const& value) const { - return isConstant(value); + return storm::utility::isConstant(value); } template