Commit d0cb8890 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Fix NaN handling for start index in ArraySplice.

Casting NaN to int is unpredictable, on different architectures it produces different int value.

TEST=test262/S15.4.4.10_A2.1_T2, S15.4.4.10_A2.2_T2, S15.4.4.12_A2.1_T2

BUG=

Review URL: https://codereview.chromium.org/14257006
Patch from Dusan Milosavljevic <Dusan.Milosavljevic@rt-rk.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 27a07001
......@@ -934,7 +934,7 @@ BUILTIN(ArraySplice) {
if (start < kMinInt || start > kMaxInt) {
return CallJsBuiltin(isolate, "ArraySplice", args);
}
relative_start = static_cast<int>(start);
relative_start = std::isnan(start) ? 0 : static_cast<int>(start);
} else if (!arg1->IsUndefined()) {
return CallJsBuiltin(isolate, "ArraySplice", args);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment