]> granicus.if.org Git - clang/commitdiff
Use 'Destroy(Context)' instead of 'Context.Deallocate()' (does recursive freeing...
authorTed Kremenek <kremenek@apple.com>
Sat, 7 Feb 2009 01:51:40 +0000 (01:51 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 7 Feb 2009 01:51:40 +0000 (01:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63998 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaType.cpp

index e206c40c3b583b5799976efc5db3678c24ad5a4e..d31402de71214f7e43fe031fcf54352337d641ec 100644 (file)
@@ -424,10 +424,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) {
         Diag(ArraySize->getLocStart(), diag::err_array_size_non_int)
           << ArraySize->getType() << ArraySize->getSourceRange();
         D.setInvalidType(true);
-        
-        Context.Deallocate(ArraySize);
-        ArraySize->~Expr();
-
+        ArraySize->Destroy(Context);
         ATI.NumElts = ArraySize = 0;
       }
       llvm::APSInt ConstVal(32);