diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-12 20:51:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-12 20:51:10 +0000 |
commit | 5186872629d6c9a48433bafe62dc06975bbbf7af (patch) | |
tree | 39d294304140b3a2194713b59d6de7a421e1a2e3 /lib/Sema/SemaDecl.cpp | |
parent | c199ab3ea1381e8e9cdd720eb87bb4f65cdf5086 (diff) |
fix a valgrind problem I noticed while developing another patch,
if a decl is invalid, it isn't added to the Decls array, so we
need to pass in Decls.size() to avoid reading uninit memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 72611ef08b..603b8b31a2 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2620,7 +2620,7 @@ Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group, } } return DeclGroupPtrTy::make(DeclGroupRef::Create(Context, - &Decls[0], NumDecls)); + &Decls[0], Decls.size())); } |