From 56a206ea5c22aad521984ad40d6be47e7e1e433d Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 5 Aug 2019 22:04:49 +0200 Subject: [PATCH] Fixed segfaults in reward parsing of DRN --- src/storm-parsers/parser/DirectEncodingParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storm-parsers/parser/DirectEncodingParser.cpp b/src/storm-parsers/parser/DirectEncodingParser.cpp index 8d0ace720..847b007cd 100644 --- a/src/storm-parsers/parser/DirectEncodingParser.cpp +++ b/src/storm-parsers/parser/DirectEncodingParser.cpp @@ -202,7 +202,7 @@ namespace storm { if (stateRewardsIt->empty()) { stateRewardsIt->resize(stateSize, storm::utility::zero()); } - (*stateRewardsIt)[row] = std::move(rewardValue); + (*stateRewardsIt)[state] = std::move(rewardValue); } ++stateRewardsIt; } @@ -293,7 +293,7 @@ namespace storm { auto rewardValue = valueParser.parseValue(rew); if (!storm::utility::isZero(rewardValue)) { if (actionRewardsIt->size() <= row) { - actionRewardsIt->resize(row + 1, storm::utility::zero()); + actionRewardsIt->resize(std::max(row + 1, stateSize), storm::utility::zero()); } (*actionRewardsIt)[row] = std::move(rewardValue); }