From: Yaron Keren Date: Sat, 24 May 2014 07:19:25 +0000 (+0000) Subject: CXXInfo memory should be released after calling the destructor X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7302a74fb4e753ee1c1b5fefb8f61b90a3cf0d9a;p=clang CXXInfo memory should be released after calling the destructor instead of before. The wrong order had no effect since Deallocate() does nothing right now, but we may replace allocator in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209567 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayout.cpp b/lib/AST/RecordLayout.cpp index 38e28d44d0..b2c244e379 100644 --- a/lib/AST/RecordLayout.cpp +++ b/lib/AST/RecordLayout.cpp @@ -21,8 +21,8 @@ void ASTRecordLayout::Destroy(ASTContext &Ctx) { if (FieldOffsets) Ctx.Deallocate(FieldOffsets); if (CXXInfo) { - Ctx.Deallocate(CXXInfo); CXXInfo->~CXXRecordLayoutInfo(); + Ctx.Deallocate(CXXInfo); } this->~ASTRecordLayout(); Ctx.Deallocate(this);