mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
8a19eb2a85
r221973 changed SmallVector::operator[] to use size_t instead of unsigned. Before that, on 64bit platforms, when a large index (say -1) was passed, truncating it to unsigned avoided an overflow when computing 'begin() + idx', and failed the range checking assertion, as expected. With r221973, idx isn't truncated, so the addition wraps to '(char*)begin() - 1', and doesn't fire anymore when it should have done so. This commit changes the comparison to instead compute 'end() - begin()' (i.e., 'size()'), which avoids potentially overflowing additions, and correctly triggers the assertion when values such as -1 are passed. Note that the problem already existed before that revision, on platforms where sizeof(size_t) == sizeof(unsigned). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225338 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
APFloat.h | ||
APInt.h | ||
APSInt.h | ||
ArrayRef.h | ||
BitVector.h | ||
DAGDeltaAlgorithm.h | ||
DeltaAlgorithm.h | ||
DenseMap.h | ||
DenseMapInfo.h | ||
DenseSet.h | ||
DepthFirstIterator.h | ||
edit_distance.h | ||
EquivalenceClasses.h | ||
FoldingSet.h | ||
GraphTraits.h | ||
Hashing.h | ||
ilist_node.h | ||
ilist.h | ||
ImmutableList.h | ||
ImmutableMap.h | ||
ImmutableSet.h | ||
IndexedMap.h | ||
IntEqClasses.h | ||
IntervalMap.h | ||
IntrusiveRefCntPtr.h | ||
iterator_range.h | ||
iterator.h | ||
MapVector.h | ||
None.h | ||
Optional.h | ||
PackedVector.h | ||
PointerIntPair.h | ||
PointerUnion.h | ||
PostOrderIterator.h | ||
PriorityQueue.h | ||
SCCIterator.h | ||
ScopedHashTable.h | ||
SetOperations.h | ||
SetVector.h | ||
SmallBitVector.h | ||
SmallPtrSet.h | ||
SmallSet.h | ||
SmallString.h | ||
SmallVector.h | ||
SparseBitVector.h | ||
SparseMultiSet.h | ||
SparseSet.h | ||
Statistic.h | ||
STLExtras.h | ||
StringExtras.h | ||
StringMap.h | ||
StringRef.h | ||
StringSet.h | ||
StringSwitch.h | ||
TinyPtrVector.h | ||
Triple.h | ||
Twine.h | ||
UniqueVector.h | ||
VariadicFunction.h |