mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
// 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
|
// 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.
|
// 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;
|
category = fcZero;
|
||||||
fs = opOK;
|
fs = opOK;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user