summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-03-12 13:49:45 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-03-12 13:49:45 +0000
commit0c22d5a3392e21772ec7c29ba1bdc818f9ab61e5 (patch)
tree136aad45d46fab6fe8fc2936f24860c874b4c6a2 /clang/lib/CodeGen
parent92bdaabf97fbe98bdb28c992df624b18d9c3c7e1 (diff)
downloadbcm5719-llvm-0c22d5a3392e21772ec7c29ba1bdc818f9ab61e5.tar.gz
bcm5719-llvm-0c22d5a3392e21772ec7c29ba1bdc818f9ab61e5.zip
Instead of dereferencing std::vector::end() (which is UB and causes failed assertions in debug builds with Visual Studio), use data() + size() to calculate the end iterator. Amends r231952.
llvm-svn: 232037
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 1ec37f41311..3bc9f64fe4b 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -3296,7 +3296,8 @@ MicrosoftCXXABI::getAddrOfCXXCopyCtorClosure(const CXXConstructorDecl *CD) {
CodeGenFunction::RunCleanupsScope Cleanups(CGF);
const auto *FPT = CD->getType()->castAs<FunctionProtoType>();
- ConstExprIterator ArgBegin(ArgVec.data()), ArgEnd(&*ArgVec.end());
+ ConstExprIterator ArgBegin(ArgVec.data()),
+ ArgEnd(ArgVec.data() + ArgVec.size());
CGF.EmitCallArgs(Args, FPT, ArgBegin, ArgEnd, CD, 1);
// Insert any ABI-specific implicit constructor arguments.
OpenPOWER on IntegriCloud