summaryrefslogtreecommitdiffstats
path: root/libcxx/src/exception.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-03-10 07:53:02 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-03-10 07:53:02 +0000
commitb952e2287bfc86509746373593ad350c39a1c45c (patch)
tree5ef2142672344fa39733aa9de88c8305fccbb285 /libcxx/src/exception.cpp
parent17f5dbef9bf15af43c93fe0662051cb24d4ae4f9 (diff)
downloadbcm5719-llvm-b952e2287bfc86509746373593ad350c39a1c45c.tar.gz
bcm5719-llvm-b952e2287bfc86509746373593ad350c39a1c45c.zip
Fix a bug where the code would use subscript a std::vector with the size
of the vector. For a vector 'v', '&v[v.size()]' isn't a valid way to compute a pointer one-past-the-end of the vector. Instead, write the loop in terms of iterators and save the beginning iterator. Once we have that we can compute the beginning pointer from the beginning iterator, and compute the distance which we should increment the beginning pointer by subtracting the iterators. What might be simpler would be to convert the function accepting a raw pointer for begin and end to accept iterators or a range or some other construct, but I wanted to keep this to a minimal bug-fix change. This fixes a crash on any debug STL implementation which checks for indexing out of bounds. llvm-svn: 231765
Diffstat (limited to 'libcxx/src/exception.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud