Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: src/isolate.cc

Issue 345533002: Fix stack capture on overflow for Error.stackTraceLimit == Infinity (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use FastD2IChecked Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/conversions.h ('k') | test/mjsunit/stack-traces-overflow.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 9ec3c9b2896b4bc294853e6cd82b929d55b51547..a4b311f6ecacd7d4b4a760931475bf4d9405c2ec 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -792,9 +792,8 @@ Object* Isolate::StackOverflow() {
JSObject::GetDataProperty(Handle<JSObject>::cast(error),
stackTraceLimit);
if (!stack_trace_limit->IsNumber()) return heap()->exception();
- double dlimit = stack_trace_limit->Number();
- int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit);
-
+ int limit = FastD2IChecked(stack_trace_limit->Number());
+ if (limit < 0) limit = 0;
Handle<JSArray> stack_trace = CaptureSimpleStackTrace(
exception, factory()->undefined_value(), limit);
JSObject::SetHiddenProperty(exception,
« no previous file with comments | « src/conversions.h ('k') | test/mjsunit/stack-traces-overflow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698