MIPS: Fix NaN handling for start and end indexes in ArraySlice.
Casting NaN to int is unpredictable, on different architectures it produces different int value. TEST=test262/S15.4.4.10_A2.1_T2, test262/S15.4.4.10_A2.2_T2 BUG= Review URL: https://codereview.chromium.org/14812014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14621 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
64651ed565
commit
1235ce419a
@ -845,7 +845,7 @@ BUILTIN(ArraySlice) {
|
||||
if (start < kMinInt || start > kMaxInt) {
|
||||
return CallJsBuiltin(isolate, "ArraySlice", args);
|
||||
}
|
||||
relative_start = static_cast<int>(start);
|
||||
relative_start = std::isnan(start) ? 0 : static_cast<int>(start);
|
||||
} else if (!arg1->IsUndefined()) {
|
||||
return CallJsBuiltin(isolate, "ArraySlice", args);
|
||||
}
|
||||
@ -858,7 +858,7 @@ BUILTIN(ArraySlice) {
|
||||
if (end < kMinInt || end > kMaxInt) {
|
||||
return CallJsBuiltin(isolate, "ArraySlice", args);
|
||||
}
|
||||
relative_end = static_cast<int>(end);
|
||||
relative_end = std::isnan(end) ? 0 : static_cast<int>(end);
|
||||
} else if (!arg2->IsUndefined()) {
|
||||
return CallJsBuiltin(isolate, "ArraySlice", args);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user