diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index 4412498e68cd..36e66ec966c2 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -193,8 +193,8 @@ void Resolver::resolveUndefines() { _context.searchSharedLibrariesToOverrideTentativeDefinitions(); // keep looping until no more undefines were added in last loop - unsigned int undefineGenCount = 0xFFFFFFFF; - while (undefineGenCount != _symbolTable.size()) { + unsigned int undefineGenCount; + do { undefineGenCount = _symbolTable.size(); std::vector undefines; _symbolTable.undefines(undefines); @@ -230,7 +230,7 @@ void Resolver::resolveUndefines() { } } } - } + } while (undefineGenCount != _symbolTable.size()); }