diff --git a/src/node.cc b/src/node.cc index db16e0b49272f2..85b0f88d17f574 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3541,6 +3541,14 @@ void Init(int* argc, DispatchDebugMessagesAsyncCallback); uv_unref(reinterpret_cast(&dispatch_debug_messages_async)); +#if defined(__arm__) + // See https://github.com/iojs/io.js/issues/1376 + // and https://code.google.com/p/v8/issues/detail?id=4019 + // TODO(bnoordhuis): Remove test/parallel/test-arm-math-exp-regress-1376.js + // and this workaround when v8:4019 has been fixed and the patch back-ported. + V8::SetFlagsFromString("--nofast_math", sizeof("--nofast_math") - 1); +#endif + #if defined(NODE_V8_OPTIONS) // Should come before the call to V8::SetFlagsFromCommandLine() // so the user can disable a flag --foo at run-time by passing diff --git a/test/parallel/test-arm-math-exp-regress-1376.js b/test/parallel/test-arm-math-exp-regress-1376.js new file mode 100644 index 00000000000000..fa3e3bfae15881 --- /dev/null +++ b/test/parallel/test-arm-math-exp-regress-1376.js @@ -0,0 +1,30 @@ +// See https://github.com/iojs/io.js/issues/1376 +// and https://code.google.com/p/v8/issues/detail?id=4019 + +Math.abs(-0.5); +Math.acos(-0.5); +Math.acosh(-0.5); +Math.asin(-0.5); +Math.asinh(-0.5); +Math.atan(-0.5); +Math.atanh(-0.5); +Math.cbrt(-0.5); +Math.ceil(-0.5); +Math.cos(-0.5); +Math.cosh(-0.5); +Math.exp(-0.5); +Math.expm1(-0.5); +Math.floor(-0.5); +Math.fround(-0.5); +Math.log(-0.5); +Math.log10(-0.5); +Math.log1p(-0.5); +Math.log2(-0.5); +Math.round(-0.5); +Math.sign(-0.5); +Math.sin(-0.5); +Math.sinh(-0.5); +Math.sqrt(-0.5); +Math.tan(-0.5); +Math.tanh(-0.5); +Math.trunc(-0.5);