Browse Source

Fixed segfaults in reward parsing of DRN

tempestpy_adaptions
Matthias Volk 5 years ago
parent
commit
56a206ea5c
  1. 4
      src/storm-parsers/parser/DirectEncodingParser.cpp

4
src/storm-parsers/parser/DirectEncodingParser.cpp

@ -202,7 +202,7 @@ namespace storm {
if (stateRewardsIt->empty()) { if (stateRewardsIt->empty()) {
stateRewardsIt->resize(stateSize, storm::utility::zero<ValueType>()); stateRewardsIt->resize(stateSize, storm::utility::zero<ValueType>());
} }
(*stateRewardsIt)[row] = std::move(rewardValue);
(*stateRewardsIt)[state] = std::move(rewardValue);
} }
++stateRewardsIt; ++stateRewardsIt;
} }
@ -293,7 +293,7 @@ namespace storm {
auto rewardValue = valueParser.parseValue(rew); auto rewardValue = valueParser.parseValue(rew);
if (!storm::utility::isZero(rewardValue)) { if (!storm::utility::isZero(rewardValue)) {
if (actionRewardsIt->size() <= row) { if (actionRewardsIt->size() <= row) {
actionRewardsIt->resize(row + 1, storm::utility::zero<ValueType>());
actionRewardsIt->resize(std::max(row + 1, stateSize), storm::utility::zero<ValueType>());
} }
(*actionRewardsIt)[row] = std::move(rewardValue); (*actionRewardsIt)[row] = std::move(rewardValue);
} }

Loading…
Cancel
Save