From ed9d094e618c75b73968587937e52f842ad49616 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Thu, 12 Sep 2013 20:07:53 +0000 Subject: [PATCH] ICU-10273 PluralRules FixedDecimal, avoid undefined cast from NaN to int64_t X-SVN-Rev: 34287 --- icu4c/source/i18n/plurrule.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/plurrule.cpp b/icu4c/source/i18n/plurrule.cpp index b3274f11eaf..960bcd2b6aa 100644 --- a/icu4c/source/i18n/plurrule.cpp +++ b/icu4c/source/i18n/plurrule.cpp @@ -1388,11 +1388,15 @@ void FixedDecimal::init(double n, int32_t v, int64_t f) { if (isNanOrInfinity) { v = 0; f = 0; + intValue = 0; + hasIntegerValue = FALSE; + } else { + intValue = (int64_t)source; + hasIntegerValue = (source == intValue); } + visibleDecimalDigitCount = v; decimalDigits = f; - intValue = (int64_t)source; - hasIntegerValue = (source == intValue); if (f == 0) { decimalDigitsWithoutTrailingZeros = 0; } else { -- 2.40.0