diff options
Diffstat (limited to 'clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp')
-rw-r--r-- | clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp b/clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp index 9acb9d0..e3ec15a 100644 --- a/clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp +++ b/clang/include/clang/Analysis/Analyses/IntervalSolver/Complete.hpp @@ -1,6 +1,7 @@ #ifndef COMPLETE_HPP #define COMPLETE_HPP +#include <cassert> #include <ostream> #include <istream> @@ -39,7 +40,11 @@ struct Complete { return Complete<T>(- _value, _infinity); } Complete operator+(const Complete& other) const { - if (_infinity) { + if (_infinity && other._infinity) { + if (_value > 0 || other._value > 0) + return Complete<T>(1, true); + return Complete<T>(-1, true); + } else if (_infinity) { return *this; } else if (other._infinity) { return other; |