[FuzzerMutate] Allow implicit truncation
If the fixed value 42 does not fit the integer type, truncate it.
This commit is contained in:
parent
1154ed8f3c
commit
8975eb3274
@ -22,7 +22,8 @@ void fuzzerop::makeConstantsWithType(Type *T, std::vector<Constant *> &Cs) {
|
||||
uint64_t W = IntTy->getBitWidth();
|
||||
Cs.push_back(ConstantInt::get(IntTy, 0));
|
||||
Cs.push_back(ConstantInt::get(IntTy, 1));
|
||||
Cs.push_back(ConstantInt::get(IntTy, 42));
|
||||
Cs.push_back(ConstantInt::get(IntTy, 42, /*IsSigned=*/false,
|
||||
/*ImplicitTrunc=*/true));
|
||||
Cs.push_back(ConstantInt::get(IntTy, APInt::getMaxValue(W)));
|
||||
Cs.push_back(ConstantInt::get(IntTy, APInt::getMinValue(W)));
|
||||
Cs.push_back(ConstantInt::get(IntTy, APInt::getSignedMaxValue(W)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user