From 14bdb7843057023b1847e37efbd7381a46bf6e5b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 12 Apr 2009 20:51:10 +0000 Subject: 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. llvm-svn: 68913 --- clang/lib/Sema/SemaDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 72611ef08b0..603b8b31a26 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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())); } -- cgit v1.2.3