diff options
author | Owen Anderson <resistor@mac.com> | 2011-07-06 22:36:59 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-07-06 22:36:59 +0000 |
commit | 9cbd7afb76f20ce874464c238764c54f86b3ce3b (patch) | |
tree | 7acc01733408ee1b1164841128edad753982669e /lib/CodeGen/LiveDebugVariables.cpp | |
parent | 4fd3c5957e6a272b60d6446e745136187d07f812 (diff) |
Fix a subtle issue in SmallVector. The following code did not work as expected:
vec.insert(vec.begin(), vec[3]);
The issue was that vec[3] returns a reference into the vector, which is invalidated when insert() memmove's the elements down to make space. The method needs to specifically detect and handle this case to correctly match std::vector's semantics.
Thanks to Howard Hinnant for clarifying the correct behavior, and explaining how std::vector solves this problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions