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

Unified Diff: vm/exceptions.cc

Issue 8587041: Fix assertion during throwing an exception. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/exceptions.cc
===================================================================
--- vm/exceptions.cc (revision 1596)
+++ vm/exceptions.cc (working copy)
@@ -59,13 +59,16 @@
// TODO(5411263): At some point we can optimize by figuring out if a
// stack trace is needed based on whether the catch code specifies a
// stack trace object or there is a rethrow in the catch clause.
- ASSERT(stack_frame_pcs.length() > 0); // At least one dart frame must exist.
Stacktrace& stacktrace = Stacktrace::Handle();
- if (existing_stacktrace.IsNull()) {
- stacktrace = Stacktrace::New(stack_frame_pcs);
+ if (stack_frame_pcs.length() > 0) {
+ if (existing_stacktrace.IsNull()) {
+ stacktrace = Stacktrace::New(stack_frame_pcs);
+ } else {
+ stacktrace ^= existing_stacktrace.raw();
+ stacktrace.Append(stack_frame_pcs);
+ }
} else {
stacktrace ^= existing_stacktrace.raw();
- stacktrace.Append(stack_frame_pcs);
}
if (FLAG_print_stack_trace_at_throw) {
OS::Print("Exception '%s' thrown:\n", exception.ToCString());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698