From adaba036485e9b1ca93849700a3da6ea3be2f1af Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Mon, 29 Apr 2019 09:25:50 +0200 Subject: [PATCH] ExpressionManager: Asserted that when getting a variable with declareOrGetVariable, the returned type is as expected. --- src/storm/storage/expressions/ExpressionManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storm/storage/expressions/ExpressionManager.cpp b/src/storm/storage/expressions/ExpressionManager.cpp index 5cc3ffcd5..ce10152e4 100644 --- a/src/storm/storage/expressions/ExpressionManager.cpp +++ b/src/storm/storage/expressions/ExpressionManager.cpp @@ -167,6 +167,7 @@ namespace storm { STORM_LOG_THROW(!checkName || isValidVariableName(name), storm::exceptions::InvalidArgumentException, "Invalid variable name '" << name << "'."); auto nameIndexPair = nameToIndexMapping.find(name); if (nameIndexPair != nameToIndexMapping.end()) { + STORM_LOG_ASSERT(indexToTypeMapping.at(nameIndexPair->second) == variableType, "Tried to declareOrGet variable '" << name << "' of type '" << variableType << "' but there is a variable with that name and different type '" << indexToTypeMapping.at(nameIndexPair->second)"'."); return Variable(this->getSharedPointer(), nameIndexPair->second); } else { uint_fast64_t offset = 0;