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

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: 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 | « no previous file | 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..ca68e608778222511bd9f9eb9f7457f9e02b68a6 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -793,8 +793,13 @@ Object* Isolate::StackOverflow() {
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;
Yang 2014/06/18 12:07:39 Can we simply use FastD2IChecked here? Also, pleas
+ if (std::isnan(dlimit) || dlimit < 0)
+ limit = 0;
+ else if (dlimit > INT_MAX)
+ limit = INT_MAX;
+ else
+ limit = static_cast<int>(dlimit);
Handle<JSArray> stack_trace = CaptureSimpleStackTrace(
exception, factory()->undefined_value(), limit);
JSObject::SetHiddenProperty(exception,
« no previous file with comments | « no previous file | test/mjsunit/stack-traces-overflow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698