Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index 8eca39207d4aa55b222870a2e36e7ce53a273bc8..e85b88a12671e491118591be28c29b4f69c7a8c3 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -234,6 +234,10 @@ inline double Floor(double x) { |
} |
inline double Pow(double x, double y) { |
+ if (y == 0.0) return 1.0; |
+ if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) { |
+ return std::numeric_limits<double>::quiet_NaN(); |
+ } |
#if (defined(__MINGW64_VERSION_MAJOR) && \ |
(!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1)) || \ |
defined(V8_OS_AIX) |