Chromium Code Reviews| Index: src/codegen.cc |
| diff --git a/src/codegen.cc b/src/codegen.cc |
| index 627e8362e67c551641174d7b161d45b27bb7761d..5193843407fa22e3b7e96532c86bf5cec342c709 100644 |
| --- a/src/codegen.cc |
| +++ b/src/codegen.cc |
| @@ -2,6 +2,10 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#if defined(_AIX) |
| +#include <fenv.h> |
| +#endif |
| + |
| #include "src/v8.h" |
| #include "src/bootstrapper.h" |
| @@ -48,7 +52,17 @@ double modulo(double x, double y) { |
| #else // POSIX |
| double modulo(double x, double y) { |
| +#if defined(_AIX) |
| + // AIX raises an underflow exception for (Number.MIN_VALUE % Number.MAX_VALUE) |
| + double result; |
|
Sven Panne
2015/01/27 11:47:05
Don't use a declaration without initialization her
michael_dawson
2015/01/29 00:08:29
Will do
|
| + int exception; |
| + feclearexcept(FE_ALL_EXCEPT); |
| + result = std::fmod(x, y); |
| + exception = fetestexcept(FE_UNDERFLOW); |
| + return (exception ? x : result); |
| +#else |
| return std::fmod(x, y); |
| +#endif |
| } |
| #endif // defined(_WIN64) |