Commit c7b2f06
committed
[APInt] Assert correct values in APInt constructor
If the uint64_t constructor is used, assert that the value is
actuall a signed or unsigned N-bit integer depending on whether
the isSigned flag is set.
Currently, we allow values to be silently truncated, which is
a constant source of subtle bugs -- a particularly common mistake
is to create -1 values without setting the isSigned flag, which
will work fine for all common bit widths (<= 64-bit) and miscompile
for larger integers.1 parent 4f381af commit c7b2f06
File tree
37 files changed
+389
-349
lines changed- llvm
- include/llvm/ADT
- lib
- Analysis
- Bitcode/Reader
- CodeGen
- SelectionDAG
- Frontend/OpenMP
- FuzzMutate
- IR
- Support
- Transforms
- IPO
- InstCombine
- Scalar
- Utils
- Vectorize
- unittests
- ADT
- Analysis
- FuzzMutate
- IR
- Support
37 files changed
+389
-349
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
111 | 125 | | |
112 | 126 | | |
113 | | - | |
| 127 | + | |
| 128 | + | |
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
| 893 | + | |
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
| |||
3322 | 3323 | | |
3323 | 3324 | | |
3324 | 3325 | | |
3325 | | - | |
3326 | | - | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
3327 | 3329 | | |
3328 | 3330 | | |
3329 | 3331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
| 678 | + | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1458 | 1458 | | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | | - | |
| 1461 | + | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
1476 | | - | |
| 1476 | + | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8698 | 8698 | | |
8699 | 8699 | | |
8700 | 8700 | | |
8701 | | - | |
| 8701 | + | |
8702 | 8702 | | |
8703 | 8703 | | |
8704 | 8704 | | |
| |||
8849 | 8849 | | |
8850 | 8850 | | |
8851 | 8851 | | |
8852 | | - | |
| 8852 | + | |
8853 | 8853 | | |
8854 | 8854 | | |
8855 | 8855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3062 | 3062 | | |
3063 | 3063 | | |
3064 | 3064 | | |
3065 | | - | |
| 3065 | + | |
3066 | 3066 | | |
3067 | 3067 | | |
3068 | 3068 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1603 | 1603 | | |
1604 | 1604 | | |
1605 | 1605 | | |
1606 | | - | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
1607 | 1610 | | |
1608 | 1611 | | |
1609 | 1612 | | |
| |||
0 commit comments