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

Side by Side Diff: runtime/vm/exceptions.cc

Issue 2670713004: VM: Don't overwrite stacktrace when rethrowing StackOverflow. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // No Dart frame. 414 // No Dart frame.
415 ASSERT(incoming_exception.raw() == 415 ASSERT(incoming_exception.raw() ==
416 isolate->object_store()->out_of_memory()); 416 isolate->object_store()->out_of_memory());
417 const UnhandledException& error = UnhandledException::Handle( 417 const UnhandledException& error = UnhandledException::Handle(
418 zone, isolate->object_store()->preallocated_unhandled_exception()); 418 zone, isolate->object_store()->preallocated_unhandled_exception());
419 thread->long_jump_base()->Jump(1, error); 419 thread->long_jump_base()->Jump(1, error);
420 UNREACHABLE(); 420 UNREACHABLE();
421 } 421 }
422 stacktrace ^= isolate->object_store()->preallocated_stack_trace(); 422 stacktrace ^= isolate->object_store()->preallocated_stack_trace();
423 PreallocatedStackTraceBuilder frame_builder(stacktrace); 423 PreallocatedStackTraceBuilder frame_builder(stacktrace);
424 if (handler_needs_stacktrace) { 424 ASSERT(existing_stacktrace.IsNull() ||
425 (existing_stacktrace.raw() == stacktrace.raw()));
426 ASSERT(existing_stacktrace.IsNull() || is_rethrow);
427 if (handler_needs_stacktrace && existing_stacktrace.IsNull()) {
425 BuildStackTrace(&frame_builder); 428 BuildStackTrace(&frame_builder);
426 } 429 }
427 } else { 430 } else {
428 if (!existing_stacktrace.IsNull()) { 431 if (!existing_stacktrace.IsNull()) {
429 // If we have an existing stack trace then this better be a rethrow. The 432 // If we have an existing stack trace then this better be a rethrow. The
430 // reverse is not necessarily true (e.g. Dart_PropagateError can cause 433 // reverse is not necessarily true (e.g. Dart_PropagateError can cause
431 // a rethrow being called without an existing stacktrace.) 434 // a rethrow being called without an existing stacktrace.)
432 ASSERT(is_rethrow); 435 ASSERT(is_rethrow);
433 stacktrace = existing_stacktrace.raw(); 436 stacktrace = existing_stacktrace.raw();
434 } else { 437 } else {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 class_name = &Symbols::_CompileTimeError(); 813 class_name = &Symbols::_CompileTimeError();
811 break; 814 break;
812 } 815 }
813 816
814 return DartLibraryCalls::InstanceCreate(library, *class_name, 817 return DartLibraryCalls::InstanceCreate(library, *class_name,
815 *constructor_name, arguments); 818 *constructor_name, arguments);
816 } 819 }
817 820
818 821
819 } // namespace dart 822 } // namespace dart
OLDNEW
« 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