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

Unified Diff: runtime/vm/parser.cc

Issue 23445012: Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handl… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 26792)
+++ runtime/vm/parser.cc (working copy)
@@ -6554,6 +6554,7 @@
current_block_->scope->AddLabel(end_catch_label);
const GrowableObjectArray& handler_types =
GrowableObjectArray::Handle(GrowableObjectArray::New());
+ bool needs_stacktrace = false;
while ((CurrentToken() == Token::kCATCH) || IsLiteral("on")) {
const intptr_t catch_pos = TokenPos();
CatchParamDesc exception_param;
@@ -6614,6 +6615,7 @@
// A stack trace variable is specified in this block, so generate code
// to load the stack trace object (:stacktrace_var) into the stack trace
// variable specified in this block.
+ needs_stacktrace = true;
ArgumentListNode* no_args = new ArgumentListNode(catch_pos);
LocalVariable* trace = LookupLocalScope(*stack_trace_param.var);
ASSERT(catch_trace_var != NULL);
@@ -6730,7 +6732,8 @@
catch_trace_var,
(finally_block != NULL)
? AllocateTryIndex()
- : CatchClauseNode::kInvalidTryIndex);
+ : CatchClauseNode::kInvalidTryIndex,
+ needs_stacktrace);
// Now create the try/catch ast node and return it. If there is a label
// on the try/catch, close the block that's embedding the try statement

Powered by Google App Engine
This is Rietveld 408576698