diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-04-08 20:18:15 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-08 20:18:15 +0000 |
| commit | 17b36271e72c4279c72c310700ce15aaa0ef53ad (patch) | |
| tree | 6300764fecc7cd0c9c0d7982d6e976e92e09d1ae /clang/lib | |
| parent | 94f4248086733c02c28461b5799421de8b161fac (diff) | |
| download | bcm5719-llvm-17b36271e72c4279c72c310700ce15aaa0ef53ad.tar.gz bcm5719-llvm-17b36271e72c4279c72c310700ce15aaa0ef53ad.zip | |
Fix buffer overrun when laying out synthesized ivars.
llvm-svn: 68634
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 307c0e4454a..d056ed4cb70 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -679,7 +679,8 @@ ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) { // Allocate and assign into ASTRecordLayouts here. The "Entry" reference can // be invalidated (dangle) if the ASTRecordLayouts hashtable is inserted into. ASTRecordLayout *NewEntry = NULL; - unsigned FieldCount = D->ivar_size(); + unsigned FieldCount = + D->ivar_size() + std::distance(D->prop_begin(), D->prop_end()); if (ObjCInterfaceDecl *SD = D->getSuperClass()) { FieldCount++; const ASTRecordLayout &SL = getASTObjCInterfaceLayout(SD); |

