diff options
author | Brad King <brad.king@kitware.com> | 2024-09-17 17:54:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-09-20 17:45:45 (GMT) |
commit | 80327430adfc9dccf8b0ac4029694135f7cb7be7 (patch) | |
tree | 3172661b757a74bdea1851e8604b9cca565e3e6f /Source | |
parent | 445a82e5da1ad5d17db7e7c3ed3b1a8b1d629e21 (diff) | |
download | CMake-80327430adfc9dccf8b0ac4029694135f7cb7be7.zip CMake-80327430adfc9dccf8b0ac4029694135f7cb7be7.tar.gz CMake-80327430adfc9dccf8b0ac4029694135f7cb7be7.tar.bz2 |
cmComputeLinkDepends: Avoid unsigned integer rollover
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 1c7b478..abdd576 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -1494,9 +1494,8 @@ void cmComputeLinkDepends::OrderLinkEntries() this->ComponentOrderId = n; // Run in reverse order so the topological order will preserve the // original order where there are no constraints. - for (size_t c = n - 1; c != cmComputeComponentGraph::INVALID_COMPONENT; - --c) { - this->VisitComponent(c); + for (size_t c = n; c > 0; --c) { + this->VisitComponent(c - 1); } // Display the component graph. |