Browse Source

Fixed error in *Literal::clone()

tempestpy_adaptions
gereon 12 years ago
parent
commit
766a92db3a
  1. 2
      src/ir/expressions/BooleanLiteral.h
  2. 2
      src/ir/expressions/DoubleLiteral.h
  3. 3
      src/ir/expressions/IntegerLiteral.h

2
src/ir/expressions/BooleanLiteral.h

@ -27,7 +27,7 @@ public:
}
virtual std::shared_ptr<BaseExpression> clone(const std::map<std::string, std::string>& renaming, const std::map<std::string, uint_fast64_t>& bools, const std::map<std::string, uint_fast64_t>& ints) {
return std::shared_ptr<BaseExpression>(this);
return std::shared_ptr<BaseExpression>(new BooleanLiteral(this->value));
}
virtual bool getValueAsBool(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const {

2
src/ir/expressions/DoubleLiteral.h

@ -31,7 +31,7 @@ public:
}
virtual std::shared_ptr<BaseExpression> clone(const std::map<std::string, std::string>& renaming, const std::map<std::string, uint_fast64_t>& bools, const std::map<std::string, uint_fast64_t>& ints) {
return std::shared_ptr<BaseExpression>(this);
return std::shared_ptr<BaseExpression>(new DoubleLiteral(this->value));
}
virtual double getValueAsDouble(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const {

3
src/ir/expressions/IntegerLiteral.h

@ -24,11 +24,10 @@ public:
}
virtual ~IntegerLiteral() {
}
virtual std::shared_ptr<BaseExpression> clone(const std::map<std::string, std::string>& renaming, const std::map<std::string, uint_fast64_t>& bools, const std::map<std::string, uint_fast64_t>& ints) {
return std::shared_ptr<BaseExpression>(this);
return std::shared_ptr<BaseExpression>(new IntegerLiteral(this->value));
}
virtual int_fast64_t getValueAsInt(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const {

Loading…
Cancel
Save