From 766a92db3ab372a3c88f7827f4c3f0e6049b514d Mon Sep 17 00:00:00 2001 From: gereon Date: Tue, 23 Apr 2013 20:28:31 +0200 Subject: [PATCH] Fixed error in *Literal::clone() --- src/ir/expressions/BooleanLiteral.h | 2 +- src/ir/expressions/DoubleLiteral.h | 2 +- src/ir/expressions/IntegerLiteral.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ir/expressions/BooleanLiteral.h b/src/ir/expressions/BooleanLiteral.h index e2d17fb0f..f6bcd3ab3 100644 --- a/src/ir/expressions/BooleanLiteral.h +++ b/src/ir/expressions/BooleanLiteral.h @@ -27,7 +27,7 @@ public: } virtual std::shared_ptr clone(const std::map& renaming, const std::map& bools, const std::map& ints) { - return std::shared_ptr(this); + return std::shared_ptr(new BooleanLiteral(this->value)); } virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const { diff --git a/src/ir/expressions/DoubleLiteral.h b/src/ir/expressions/DoubleLiteral.h index 20d43d464..4717b6708 100644 --- a/src/ir/expressions/DoubleLiteral.h +++ b/src/ir/expressions/DoubleLiteral.h @@ -31,7 +31,7 @@ public: } virtual std::shared_ptr clone(const std::map& renaming, const std::map& bools, const std::map& ints) { - return std::shared_ptr(this); + return std::shared_ptr(new DoubleLiteral(this->value)); } virtual double getValueAsDouble(std::pair, std::vector> const* variableValues) const { diff --git a/src/ir/expressions/IntegerLiteral.h b/src/ir/expressions/IntegerLiteral.h index 7ff615ee4..5a42671cd 100644 --- a/src/ir/expressions/IntegerLiteral.h +++ b/src/ir/expressions/IntegerLiteral.h @@ -24,11 +24,10 @@ public: } virtual ~IntegerLiteral() { - } virtual std::shared_ptr clone(const std::map& renaming, const std::map& bools, const std::map& ints) { - return std::shared_ptr(this); + return std::shared_ptr(new IntegerLiteral(this->value)); } virtual int_fast64_t getValueAsInt(std::pair, std::vector> const* variableValues) const {