mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
[APFloat] Swap an early out check so we do not dereference str.end().
Originally if D.firstSigDigit == str.end(), we will have already dereferenced D.firstSigDigit in the first predicate. llvm-svn: 185437
This commit is contained in:
parent
304ef43e7d
commit
a8c2154e69
@ -2488,7 +2488,7 @@ APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
|
||||
// D->firstSigDigit equals str.end(), every digit must be a zero and there can
|
||||
// be at most one dot. On the other hand, if we have a zero with a non-zero
|
||||
// exponent, then we know that D.firstSigDigit will be non-numeric.
|
||||
if (decDigitValue(*D.firstSigDigit) >= 10U || D.firstSigDigit == str.end()) {
|
||||
if (D.firstSigDigit == str.end() || decDigitValue(*D.firstSigDigit) >= 10U) {
|
||||
category = fcZero;
|
||||
fs = opOK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user