diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2008-06-01 22:53:53 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2008-06-01 22:53:53 +0000 |
commit | 3fe4651e2ebc5f94dcefb0691c7bcd93ccd827d9 (patch) | |
tree | 6b7e4faaea7d260e4af1a38ed65a26a275d6bda0 /clang/lib/Sema/SemaDecl.cpp | |
parent | 38099c1b6ef26fb6651f2aaa700c3c1de6e1c2ee (diff) | |
download | bcm5719-llvm-3fe4651e2ebc5f94dcefb0691c7bcd93ccd827d9.tar.gz bcm5719-llvm-3fe4651e2ebc5f94dcefb0691c7bcd93ccd827d9.zip |
fix decl attributes cleaning
this plugs the leak of attributes and also fixes a crash in the test
llvm-svn: 51862
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index eb0abafcaaa..230ea3cb9da 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -276,7 +276,6 @@ static bool DeclHasAttr(const Decl *decl, const Attr *target) { static void MergeAttributes(Decl *New, Decl *Old) { Attr *attr = const_cast<Attr*>(Old->getAttrs()), *tmp; -// FIXME: fix this code to cleanup the Old attrs correctly while (attr) { tmp = attr; attr = attr->getNext(); @@ -288,6 +287,8 @@ static void MergeAttributes(Decl *New, Decl *Old) { delete(tmp); } } + + Old->invalidateAttrs(); } /// MergeFunctionDecl - We just parsed a function 'New' from |