]> granicus.if.org Git - clang/commitdiff
CXXInfo memory should be released after calling the destructor
authorYaron Keren <yaron.keren@gmail.com>
Sat, 24 May 2014 07:19:25 +0000 (07:19 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Sat, 24 May 2014 07:19:25 +0000 (07:19 +0000)
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

lib/AST/RecordLayout.cpp

index 38e28d44d0ff06545b24e216d1e9244666838466..b2c244e3790ef5c05648797d15514b3ddacb699a 100644 (file)
@@ -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);