From 47f7bf875d3e81dc8c7d7c52142fbe00c612a4e0 Mon Sep 17 00:00:00 2001 From: PBerger Date: Mon, 16 Sep 2013 02:04:08 +0200 Subject: [PATCH] Fixed static conversion bugs in the IR section Former-commit-id: 6b63d4900e1c07c1a150f2403f3d517dd1822f1c --- src/ir/expressions/IntegerConstantExpression.cpp | 2 +- src/ir/expressions/IntegerLiteralExpression.cpp | 2 +- src/ir/expressions/VariableExpression.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ir/expressions/IntegerConstantExpression.cpp b/src/ir/expressions/IntegerConstantExpression.cpp index 4daa4c244..40a5c9317 100644 --- a/src/ir/expressions/IntegerConstantExpression.cpp +++ b/src/ir/expressions/IntegerConstantExpression.cpp @@ -27,7 +27,7 @@ namespace storm { } double IntegerConstantExpression::getValueAsDouble(std::pair, std::vector> const* variableValues) const { - return getValueAsInt(variableValues); + return static_cast(getValueAsInt(variableValues)); } int_fast64_t IntegerConstantExpression::getValueAsInt(std::pair, std::vector> const* variableValues) const { diff --git a/src/ir/expressions/IntegerLiteralExpression.cpp b/src/ir/expressions/IntegerLiteralExpression.cpp index 70432c6c5..7d4f02d99 100644 --- a/src/ir/expressions/IntegerLiteralExpression.cpp +++ b/src/ir/expressions/IntegerLiteralExpression.cpp @@ -27,7 +27,7 @@ namespace storm { } double IntegerLiteralExpression::getValueAsDouble(std::pair, std::vector> const* variableValues) const { - return value; + return static_cast(value); } int_fast64_t IntegerLiteralExpression::getValueAsInt(std::pair, std::vector> const* variableValues) const { diff --git a/src/ir/expressions/VariableExpression.cpp b/src/ir/expressions/VariableExpression.cpp index a38529c8b..5cd96ce45 100644 --- a/src/ir/expressions/VariableExpression.cpp +++ b/src/ir/expressions/VariableExpression.cpp @@ -83,7 +83,7 @@ namespace storm { // Because only int variables can deliver a double value, we only need to check them. if (variableValues != nullptr) { - return variableValues->second[globalIndex]; + return static_cast(variableValues->second[globalIndex]); } else { throw storm::exceptions::ExpressionEvaluationException() << "Cannot evaluate expression with variable '" << variableName << "' of type double."; }