diff options
Diffstat (limited to 'kjs')
-rw-r--r-- | kjs/dtoa.cpp | 6 | ||||
-rw-r--r-- | kjs/grammar.cpp | 2 | ||||
-rw-r--r-- | kjs/value.cpp | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/kjs/dtoa.cpp b/kjs/dtoa.cpp index c39fa5bc6..8fc79ddf7 100644 --- a/kjs/dtoa.cpp +++ b/kjs/dtoa.cpp @@ -2077,7 +2077,7 @@ strtod else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { drop_down: /* boundary case -- decrement exponent */ -#ifdef Sudden_Underflow /*{{*/ +#ifdef Sudden_Underflow L = word0(rv) & Exp_mask; #ifdef IBM if (L < Exp_msk1) @@ -2086,8 +2086,8 @@ strtod if (L <= (scale ? (2*P+1)*Exp_msk1 : Exp_msk1)) #else if (L <= Exp_msk1) -#endif /*Avoid_Underflow*/ -#endif /*IBM*/ +#endif +#endif goto undfl; L -= Exp_msk1; #else /*Sudden_Underflow}{*/ diff --git a/kjs/grammar.cpp b/kjs/grammar.cpp index 03eb07876..9cc7a342f 100644 --- a/kjs/grammar.cpp +++ b/kjs/grammar.cpp @@ -1340,7 +1340,9 @@ while (0) # define YYDPRINTF(Args) \ do { \ if (yydebug) \ + { \ YYFPRINTF Args; \ + } \ } while (0) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ diff --git a/kjs/value.cpp b/kjs/value.cpp index bbf5a05c1..d5a7a9731 100644 --- a/kjs/value.cpp +++ b/kjs/value.cpp @@ -361,11 +361,12 @@ Number::Number(int i) Number::Number(unsigned int u) : Value(SimpleNumber::fits(u) ? SimpleNumber::make(u) : new NumberImp(static_cast<double>(u))) { } -Number::Number(double d) +// check for NaN first if we werent't compiled with -mieee on Alpha #if defined(__alpha) && !defined(_IEEE_FP) - // check for NaN first if we werent't compiled with -mieee on Alpha +Number::Number(double d) : Value(KJS::isNaN(d) ? NumberImp::staticNaN : (SimpleNumber::fits(d) ? SimpleNumber::make((long)d) : new NumberImp(d))) { } #else +Number::Number(double d) : Value(SimpleNumber::fits(d) ? SimpleNumber::make((long)d) : (KJS::isNaN(d) ? NumberImp::staticNaN : new NumberImp(d))) { } #endif |