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

Unified Diff: runtime/vm/parser.cc

Issue 11946020: Check whether exceptions are caught (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 17157)
+++ runtime/vm/parser.cc (working copy)
@@ -6063,8 +6063,17 @@
catch_pos, Token::kIS, exception_var, exception_type);
current_block_->statements->Add(
new IfNode(catch_pos, type_cond_expr, catch_handler, NULL));
- ASSERT(exception_type->type().IsInstantiated());
- handler_types.Add(*exception_param.type);
+
+ // Do not add uninstantiated types (e.g. type parameter T or
+ // generic type List<T>), since the debugger won't be able to
+ // instantiate it when walking the stack.
+ // This means that the debugger is not able to determine whether
+ // an exception is caught if the catch clause uses generic types.
+ // It will report the exception as uncaught when in fact it might
+ // be caught and handled when we unwind the stack.
+ if (exception_param.type->IsInstantiated()) {
+ handler_types.Add(*exception_param.type);
+ }
} else {
// No exception type exists in the catch specifier so execute the
// catch handler code unconditionally.
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698