fix for fencepost error when looping over vectors

This commit is contained in:
Vern Paxson 2021-02-25 15:29:14 -08:00
parent b6f4f897c6
commit 53fea053de

View file

@ -1324,7 +1324,7 @@ ValPtr ForStmt::DoExec(Frame* f, Val* v, StmtFlowType& flow) const
{ {
VectorVal* vv = v->AsVectorVal(); VectorVal* vv = v->AsVectorVal();
for ( auto i = 0u; i <= vv->Size(); ++i ) for ( auto i = 0u; i < vv->Size(); ++i )
{ {
// Set the loop variable to the current index, and make // Set the loop variable to the current index, and make
// another pass over the loop body. // another pass over the loop body.