forked from OSchip/llvm-project
[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:
parent
d8fc4e9c0d
commit
d7e65757ed
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue