Skip to content

Commit

Permalink
[MERGE #4400 @Penguinwizzard] Tell PREfast about iterator bounds.
Browse files Browse the repository at this point in the history
Merge pull request #4400 from Penguinwizzard:prefast_wasmbinaryreader

We know that the iterator will iterate over Count() elements, so we
can tell PREfast to assume that.
  • Loading branch information
Penguinwizzard committed Dec 11, 2017
2 parents bb19de1 + bb5ad88 commit c8d1549
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/WasmReader/WasmBinaryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ void WasmBinaryReader::PrintOps()
int i = 0;
while (iter.IsValid())
{
__analysis_assume(i < count);
ops[i] = iter.CurrentKey();
iter.MoveNext();
++i;
Expand Down

0 comments on commit c8d1549

Please sign in to comment.