forked from OSchip/llvm-project
f60e319419
Summary: When constructing an APSInt from a string, the constructor doesn't correctly truncate the bit width of the result if the passed in string was "0" (or any alternative way to express 0 like "-0" or "000"). Instead of 1 (which is the smallest allowed bit width) it returns an APSInt with a bit width of 5. The reason is that the constructor checks that it never truncates the result to the invalid bit width of 0, so when it calculates that storing a "0" doesn't require any bits it just keeps the original overestimated bit width (which happens to be 5). This patch just sets the bit width of the result to 1 if the required bit width is 0. Reviewers: arphaman, dexonsmith Reviewed By: dexonsmith Subscribers: hiraditya, dexonsmith, JDevlieghere, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81329 |
||
---|---|---|
.. | ||
APFloatTest.cpp | ||
APIntTest.cpp | ||
APSIntTest.cpp | ||
AnyTest.cpp | ||
ArrayRefTest.cpp | ||
BitVectorTest.cpp | ||
BitmaskEnumTest.cpp | ||
BreadthFirstIteratorTest.cpp | ||
BumpPtrListTest.cpp | ||
CMakeLists.txt | ||
CoalescingBitVectorTest.cpp | ||
DAGDeltaAlgorithmTest.cpp | ||
DeltaAlgorithmTest.cpp | ||
DenseMapTest.cpp | ||
DenseSetTest.cpp | ||
DepthFirstIteratorTest.cpp | ||
DirectedGraphTest.cpp | ||
EnumeratedArrayTest.cpp | ||
EquivalenceClassesTest.cpp | ||
FallibleIteratorTest.cpp | ||
FloatingPointMode.cpp | ||
FoldingSet.cpp | ||
FunctionExtrasTest.cpp | ||
FunctionRefTest.cpp | ||
HashingTest.cpp | ||
IListBaseTest.cpp | ||
IListIteratorTest.cpp | ||
IListNodeBaseTest.cpp | ||
IListNodeTest.cpp | ||
IListSentinelTest.cpp | ||
IListTest.cpp | ||
ImmutableListTest.cpp | ||
ImmutableMapTest.cpp | ||
ImmutableSetTest.cpp | ||
IntEqClassesTest.cpp | ||
IntervalMapTest.cpp | ||
IntrusiveRefCntPtrTest.cpp | ||
IteratorTest.cpp | ||
MapVectorTest.cpp | ||
MappedIteratorTest.cpp | ||
OptionalTest.cpp | ||
PackedVectorTest.cpp | ||
PointerEmbeddedIntTest.cpp | ||
PointerIntPairTest.cpp | ||
PointerSumTypeTest.cpp | ||
PointerUnionTest.cpp | ||
PostOrderIteratorTest.cpp | ||
PriorityWorklistTest.cpp | ||
RangeAdapterTest.cpp | ||
SCCIteratorTest.cpp | ||
STLExtrasTest.cpp | ||
ScopeExitTest.cpp | ||
SequenceTest.cpp | ||
SetVectorTest.cpp | ||
SimpleIListTest.cpp | ||
SmallPtrSetTest.cpp | ||
SmallSetTest.cpp | ||
SmallStringTest.cpp | ||
SmallVectorTest.cpp | ||
SparseBitVectorTest.cpp | ||
SparseMultiSetTest.cpp | ||
SparseSetTest.cpp | ||
StatisticTest.cpp | ||
StringExtrasTest.cpp | ||
StringMapTest.cpp | ||
StringRefTest.cpp | ||
StringSetTest.cpp | ||
StringSwitchTest.cpp | ||
TestGraph.h | ||
TinyPtrVectorTest.cpp | ||
TripleTest.cpp | ||
TwineTest.cpp | ||
TypeSwitchTest.cpp | ||
TypeTraitsTest.cpp | ||
WaymarkingTest.cpp |