Commit 9be937e6 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: fix NaN handling of Isolate::StackOverflow()

The mjsunit/stack-traces-overflow.js test fails on MIPS target as Error.stackTraceLimit = NaN; should disable stack trace messages and Isolate::StackOverflow() assumes static_cast<int>(double NaN) < 0.

MIPS has a different NaN representation than other architectures so the NaN value casted to int is positive. This patch adds an isnan() check to make the handling of NaN uniform on all architectures.

BUG=

Review URL: https://codereview.chromium.org/12600003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13900 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b09f9bfe
......@@ -1042,7 +1042,8 @@ Failure* Isolate::StackOverflow() {
Handle<Object> stack_trace_limit =
GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit");
if (!stack_trace_limit->IsNumber()) return Failure::Exception();
int limit = static_cast<int>(stack_trace_limit->Number());
double dlimit = stack_trace_limit->Number();
int limit = isnan(dlimit) ? 0 : static_cast<int>(dlimit);
Handle<JSArray> stack_trace = CaptureSimpleStackTrace(
exception, factory()->undefined_value(), limit);
......
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