From 904a7aecc04fdcefd9fc06594728e7cc8ae361cb Mon Sep 17 00:00:00 2001 From: ThomasH Date: Mon, 26 Oct 2015 18:47:25 +0100 Subject: [PATCH] resolve bug (index out of bounds exception) Former-commit-id: ffc7970e50551ffc8e0794f9f29e566906192416 --- src/storage/gspn/Marking.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/gspn/Marking.cpp b/src/storage/gspn/Marking.cpp index 1e6192e3e..3e8b69106 100644 --- a/src/storage/gspn/Marking.cpp +++ b/src/storage/gspn/Marking.cpp @@ -20,7 +20,7 @@ namespace storm { void Marking::setNumberOfTokensAt(uint_fast64_t place, uint_fast64_t numberOfTokens) { //check range - for (uint_fast64_t i = getNumberOfPlaces() * numberOfBits; i <(getNumberOfPlaces() * numberOfBits) + numberOfBits; ++i) { + for (uint_fast64_t i = place * numberOfBits; i <(place * numberOfBits) + numberOfBits; ++i) { if (numberOfTokens % 2 == 0) { marking.set(i, false); } else { @@ -32,7 +32,7 @@ namespace storm { uint_fast64_t Marking::getNumberOfTokensAt(uint_fast64_t place) { uint_fast64_t tokens = 0; - for (uint_fast64_t i = getNumberOfPlaces() * numberOfBits, mult = 0; i <(getNumberOfPlaces() * numberOfBits) + numberOfBits; ++i, ++mult) { + for (uint_fast64_t i = place * numberOfBits, mult = 0; i < (place * numberOfBits) + numberOfBits; ++i, ++mult) { if (marking.get(i)) { tokens += std::pow(2, mult); }