From 188cafb03057fe6bfe5809b61782407d22995ca5 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Sat, 24 May 2014 07:19:25 +0000 Subject: [PATCH] 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. llvm-svn: 209567 --- clang/lib/AST/RecordLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/RecordLayout.cpp b/clang/lib/AST/RecordLayout.cpp index 38e28d44d0ff..b2c244e3790e 100644 --- a/clang/lib/AST/RecordLayout.cpp +++ b/clang/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);