From be5e1a1baff7dbb1e1cefd2304152b1c6f3e39d5 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Thu, 14 Sep 2017 16:36:24 -0700 Subject: [PATCH] Use an unsigned variable to avoid comparison problems (#14001) --- src/vm/methodtable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp index 0adba6a..1b19a33 100644 --- a/src/vm/methodtable.cpp +++ b/src/vm/methodtable.cpp @@ -7074,7 +7074,7 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( InterfaceMapIterator it = this->IterateInterfaceMap(); CQuickArray candidates; - int candidatesCount = 0; + unsigned candidatesCount = 0; candidates.AllocThrows(this->GetNumInterfaces()); // @@ -7193,7 +7193,7 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( // We need to maintain the invariant that the candidates are always the most specific // in all path scaned so far. There might be multiple incompatible candidates - for (int i = 0; i < candidatesCount; ++i) + for (unsigned i = 0; i < candidatesCount; ++i) { MethodTable *pCandidateMT = candidates[i].pMT; if (pCandidateMT == NULL) @@ -7255,7 +7255,7 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( // scan to see if there are any conflicts MethodTable *pBestCandidateMT = NULL; MethodDesc *pBestCandidateMD = NULL; - for (int i = 0; i < candidatesCount; ++i) + for (unsigned i = 0; i < candidatesCount; ++i) { if (candidates[i].pMT == NULL) continue; -- 2.7.4