Use MutableArrayRef for APFloat::convertToInteger
As discussed on D31074, use MutableArrayRef for destination integer buffers to help assert before stack overflows happen. llvm-svn: 298253
This commit is contained in:
@@ -1518,9 +1518,9 @@ Constant *ConstantFoldSSEConvertToInt(const APFloat &Val, bool roundTowardZero,
|
||||
bool isExact = false;
|
||||
APFloat::roundingMode mode = roundTowardZero? APFloat::rmTowardZero
|
||||
: APFloat::rmNearestTiesToEven;
|
||||
APFloat::opStatus status = Val.convertToInteger(&UIntVal, ResultWidth,
|
||||
/*isSigned=*/true, mode,
|
||||
&isExact);
|
||||
APFloat::opStatus status =
|
||||
Val.convertToInteger(makeMutableArrayRef(UIntVal), ResultWidth,
|
||||
/*isSigned=*/true, mode, &isExact);
|
||||
if (status != APFloat::opOK &&
|
||||
(!roundTowardZero || status != APFloat::opInexact))
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user