diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2016-10-13 19:19:37 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2016-10-13 19:19:37 +0000 |
commit | 3d01ad116c85af0ba75656d6d7874dd9fda98dec (patch) | |
tree | 1d4b6dd2f8c764defd7ca89ead7a7258d46085e7 /clang/lib/CodeGen/SwiftCallingConv.cpp | |
parent | a17d23eaa7e60d54b2695e09b3aad4eb2155f629 (diff) | |
download | bcm5719-llvm-3d01ad116c85af0ba75656d6d7874dd9fda98dec.tar.gz bcm5719-llvm-3d01ad116c85af0ba75656d6d7874dd9fda98dec.zip |
Swift Calling Convention: Fix out of bounds access
Use iterator instead of address of element in vector
It is not valid to access one after the last element.
rdar://28759508
llvm-svn: 284150
Diffstat (limited to 'clang/lib/CodeGen/SwiftCallingConv.cpp')
-rw-r--r-- | clang/lib/CodeGen/SwiftCallingConv.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/SwiftCallingConv.cpp b/clang/lib/CodeGen/SwiftCallingConv.cpp index a79ddf94bc8..1629c443652 100644 --- a/clang/lib/CodeGen/SwiftCallingConv.cpp +++ b/clang/lib/CodeGen/SwiftCallingConv.cpp @@ -384,7 +384,7 @@ void SwiftAggLowering::splitVectorEntry(unsigned index) { auto eltTy = split.first; CharUnits eltSize = getTypeStoreSize(CGM, eltTy); auto numElts = split.second; - Entries.insert(&Entries[index + 1], numElts - 1, StorageEntry()); + Entries.insert(Entries.begin() + index + 1, numElts - 1, StorageEntry()); CharUnits begin = Entries[index].Begin; for (unsigned i = 0; i != numElts; ++i) { |