Allow AccumulatorStack::size to point to one past the end

this is guaranteed to be correct since we access the last element with `size - 1`

closes https://github.com/official-stockfish/Stockfish/pull/6368

fixes https://github.com/official-stockfish/Stockfish/issues/6367

no functional change
This commit is contained in:
Shawn Xu
2025-11-01 10:34:44 +01:00
committed by Joost VandeVondele
parent b9e3e7921b
commit f434cc2918
+1 -1
View File
@@ -75,7 +75,7 @@ void AccumulatorStack::reset() noexcept {
}
void AccumulatorStack::push(const DirtyPiece& dirtyPiece) noexcept {
assert(size + 1 < accumulators.size());
assert(size < accumulators.size());
accumulators[size].reset(dirtyPiece);
size++;
}