I used PVS-Studio static analyzer to check this project. I would like to suggest...
authorIlya <DieselMachine84@users.noreply.github.com>
Thu, 23 Mar 2017 13:58:18 +0000 (16:58 +0300)
committerJan Vorlicek <janvorli@microsoft.com>
Thu, 23 Mar 2017 13:58:18 +0000 (14:58 +0100)
Incorrect variable 'i' from the outer loop is used in condition of the inner loop.

Commit migrated from https://github.com/dotnet/coreclr/commit/5bcd08108f522524741805d97989e5f227a6bd6b

src/coreclr/src/tools/metainfo/mdinfo.cpp

index 1432201..753321f 100644 (file)
@@ -1418,7 +1418,7 @@ void MDInfo::DisplayFields(mdTypeDef inTypeDef, COR_FIELD_OFFSET *rFieldOffset,
             if (cFieldOffset)
             {
                 bool found = false;
-                for (ULONG iLayout = 0; i < cFieldOffset; ++iLayout)
+                for (ULONG iLayout = 0; iLayout < cFieldOffset; ++iLayout)
                 {
                     if (RidFromToken(rFieldOffset[iLayout].ridOfField) == RidFromToken(fields[i]))
                     {