From e443384b91d36d3d3db3aa435ae3ac8ff6575768 Mon Sep 17 00:00:00 2001 From: Mavo Date: Thu, 23 Jun 2016 17:39:03 +0200 Subject: [PATCH] Added assertion Former-commit-id: beeff9bff9053f9e59147b884e83b72efcab9f2f --- src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp b/src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp index 08ca016fd..0fa299321 100644 --- a/src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp +++ b/src/modelchecker/results/ExplicitQuantitativeCheckResult.cpp @@ -5,6 +5,7 @@ #include "src/utility/macros.h" #include "src/utility/vector.h" #include "src/exceptions/InvalidOperationException.h" +#include "src/exceptions/InvalidAccessException.h" #include "src/adapters/CarlAdapter.h" @@ -60,6 +61,7 @@ namespace storm { if (this->isResultForAllStates()) { map_type newMap; for (auto const& element : filterTruthValues) { + STORM_LOG_THROW(element < this->getValueVector().size(), storm::exceptions::InvalidAccessException, "Invalid index in results."); newMap.emplace(element, this->getValueVector()[element]); } this->values = newMap; @@ -253,4 +255,4 @@ namespace storm { template class ExplicitQuantitativeCheckResult; #endif } -} \ No newline at end of file +}