diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-20 14:40:12 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-20 14:40:12 +0000 |
| commit | 00b34996b49748045e2dd77e4f7ca60c258639e2 (patch) | |
| tree | da5c6c08879b6d2d2f1f2f8022248250ba4b9950 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | |
| parent | 195f23c53bb09d266b18c24519cf9bd0589972a0 (diff) | |
| download | bcm5719-llvm-00b34996b49748045e2dd77e4f7ca60c258639e2.tar.gz bcm5719-llvm-00b34996b49748045e2dd77e4f7ca60c258639e2.zip | |
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
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index a9516be8c53..dcb2a4a0c6e 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -231,8 +231,9 @@ static bool ConvertToSInt(const APFloat &APF, int64_t &IntVal) { bool isExact = false; // See if we can convert this to an int64_t uint64_t UIntVal; - if (APF.convertToInteger(&UIntVal, 64, true, APFloat::rmTowardZero, - &isExact) != APFloat::opOK || !isExact) + if (APF.convertToInteger(makeMutableArrayRef(UIntVal), 64, true, + APFloat::rmTowardZero, &isExact) != APFloat::opOK || + !isExact) return false; IntVal = UIntVal; return true; |

