[llvm] r285256 - [APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 16:31:41 PDT 2016


Author: timshen
Date: Wed Oct 26 18:31:41 2016
New Revision: 285256

URL: http://llvm.org/viewvc/llvm-project?rev=285256&view=rev
Log:
[APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.

Reviewers: kbarton, echristo, iteratee, eugenis

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D26017

Modified:
    llvm/trunk/include/llvm/ADT/APFloat.h

Modified: llvm/trunk/include/llvm/ADT/APFloat.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=285256&r1=285255&r2=285256&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APFloat.h (original)
+++ llvm/trunk/include/llvm/ADT/APFloat.h Wed Oct 26 18:31:41 2016
@@ -855,7 +855,7 @@ public:
   }
 
   bool getExactInverse(APFloat *inv) const {
-    return IEEE.getExactInverse(&inv->IEEE);
+    return IEEE.getExactInverse(inv ? &inv->IEEE : nullptr);
   }
 
   friend hash_code hash_value(const APFloat &Arg);




More information about the llvm-commits mailing list