diff options
| -rw-r--r-- | lld/lib/Driver/WinLinkDriver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 594e7f11721..826bfe2f447 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -801,8 +801,9 @@ parseArgs(int argc, const char **argv, PECOFFLinkingContext &ctx, // graph. static bool hasLibrary(PECOFFLinkingContext &ctx, File *file) { StringRef path = file->path(); - for (std::unique_ptr<Node> &p : ctx.getNodes()) - if (auto *f = dyn_cast<FileNode>(p.get())) + std::vector<std::unique_ptr<Node>> &nodes = ctx.getNodes(); + for (size_t i = 0; i < nodes.size(); ++i) + if (auto *f = dyn_cast<FileNode>(nodes[i].get())) if (f->getFile()->path() == path) return true; return false; |

