diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-10-18 06:28:10 -0700 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2021-10-18 06:28:10 -0700 |
commit | 9a1c0dc2a6a4eb42f2cc47e1bf2568845c9985db (patch) | |
tree | 4d42afa87ab815770f7b4cd22dc921ca80b19940 /src/theory/arith/error_set.h | |
parent | b17ee60bc45e030113bcfdf5cdf575b0f6f961f1 (diff) |
Fix error management of `ErrorInformation`
Fixes
https://scan6.coverity.com/reports.htm#v37053/p11644/fileInstanceId=125548448&defectInstanceId=32441274&mergedDefectId=1453884.
Diffstat (limited to 'src/theory/arith/error_set.h')
-rw-r--r-- | src/theory/arith/error_set.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/theory/arith/error_set.h b/src/theory/arith/error_set.h index 5585bf76f..36a75f12f 100644 --- a/src/theory/arith/error_set.h +++ b/src/theory/arith/error_set.h @@ -20,6 +20,7 @@ #pragma once +#include <memory> #include <vector> #include "options/arith_options.h" @@ -135,7 +136,7 @@ private: * Auxillary information for storing the difference between a variable and its bound. * Only set on signals. */ - DeltaRational* d_amount; + std::unique_ptr<DeltaRational> d_amount; /** */ uint32_t d_metric; @@ -173,7 +174,7 @@ public: inline void setInFocus(bool inFocus) { d_inFocus = inFocus; } const DeltaRational& getAmount() const { - Assert(d_amount != NULL); + Assert(d_amount != nullptr); return *d_amount; } @@ -201,9 +202,12 @@ public: << ", " << d_sgn << ", " << d_relaxed << ", " << d_inFocus; - if(d_amount == NULL){ - os << "NULL"; - }else{ + if (d_amount == nullptr) + { + os << "nullptr"; + } + else + { os << (*d_amount); } os << "}"; |