Skip to content

Commit ba1ee2b

Browse files
authored
[APInt] Enable APInt ctor assertion by default (#112670)
This enables the assertion introduced in #106524, which checks that the value passed to the APInt constructor is indeed a valid N-bit signed or unsigned integer. Places that previously violated the assertion were updated in advance, e.g. in #80309. It is possible to opt-out of the check and restore the previous behavior by setting implicitTrunc=true.
1 parent 5a09ce9 commit ba1ee2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class [[nodiscard]] APInt {
109109
/// \param implicitTrunc allow implicit truncation of non-zero/sign bits of
110110
/// val beyond the range of numBits
111111
APInt(unsigned numBits, uint64_t val, bool isSigned = false,
112-
bool implicitTrunc = true)
112+
bool implicitTrunc = false)
113113
: BitWidth(numBits) {
114114
if (!implicitTrunc) {
115115
if (isSigned) {

0 commit comments

Comments
 (0)