Revision: 14426
Author: [email protected]
Date: Wed Apr 24 12:10:02 2013
Log: 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 <[email protected]>.
http://code.google.com/p/v8/source/detail?r=14426
Modified:
/branches/bleeding_edge/src/builtins.cc
=======================================
--- /branches/bleeding_edge/src/builtins.cc Wed Apr 24 07:44:08 2013
+++ /branches/bleeding_edge/src/builtins.cc Wed Apr 24 12:10:02 2013
@@ -934,7 +934,7 @@
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);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.