[lld/mac] Tweak reserve() argument in unwind code

addEntriesForFunctionsWithoutUnwindInfo() can add entries to cuVector, so
cuCount can be stale. Use cuVector.size() instead.

No behavior change.
This commit is contained in:
Nico Weber 2021-07-07 11:44:22 -04:00
parent d8fc4e9c0d
commit d7e65757ed
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,7 @@ template <class Ptr> void UnwindInfoSectionImpl<Ptr>::finalize() {
// Rather than sort & fold the 32-byte entries directly, we create a
// vector of pointers to entries and sort & fold that instead.
cuPtrVector.reserve(cuCount);
cuPtrVector.reserve(cuVector.size());
for (CompactUnwindEntry<Ptr> &cuEntry : cuVector)
cuPtrVector.emplace_back(&cuEntry);
llvm::sort(cuPtrVector, [](const CompactUnwindEntry<Ptr> *a,