diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-14 19:31:39 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-14 19:31:39 +0000 |
commit | 314f5544fbdcfb1082df070f730fe8acbdb85180 (patch) | |
tree | a501baf40bf6a888b0251fbfd84fc5ddae18241c /lib/Sema/SemaOverload.cpp | |
parent | 47b1d96bde79633d4aeded1cde2c5f870a58af24 (diff) |
Give OverloadCandidateSet the responsibility for destroying the implicit conversion sequences so we don't get double frees when the vector reallocates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 7f1c86c224..2706aeaf1d 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -541,9 +541,13 @@ OverloadCandidate::DeductionFailureInfo::getSecondArg() { } void OverloadCandidateSet::clear() { + for (unsigned i = 0, e = NumInlineSequences; i != e; ++i) + reinterpret_cast<ImplicitConversionSequence*>(InlineSpace)[i] + .~ImplicitConversionSequence(); + NumInlineSequences = 0; + ConversionSequenceAllocator.DestroyAll(); Candidates.clear(); Functions.clear(); - NumInlineSequences = 0; } namespace { |