Chromium Code Reviews| Index: runtime/vm/exceptions.cc |
| diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc |
| index 37a99f25dcae5330f9ae9ccad548e67247c7825b..10fb34b5851681260d3748eacd0231584e95ac76 100644 |
| --- a/runtime/vm/exceptions.cc |
| +++ b/runtime/vm/exceptions.cc |
| @@ -11,6 +11,7 @@ |
| #include "vm/debugger.h" |
| #include "vm/flags.h" |
| #include "vm/log.h" |
| +#include "vm/longjump.h" |
| #include "vm/object.h" |
| #include "vm/object_store.h" |
| #include "vm/stack_frame.h" |
| @@ -146,7 +147,7 @@ static bool FindExceptionHandler(Thread* thread, |
| bool* needs_stacktrace) { |
| StackFrameIterator frames(StackFrameIterator::kDontValidateFrames); |
| StackFrame* frame = frames.NextFrame(); |
| - ASSERT(frame != NULL); // We expect to find a dart invocation frame. |
| + if (frame == NULL) return false; |
|
rmacnak
2016/09/13 23:29:56
// No Dart frame.
Florian Schneider
2016/09/14 00:13:21
Done.
|
| bool handler_pc_set = false; |
| *needs_stacktrace = false; |
| bool is_catch_all = false; |
| @@ -327,6 +328,14 @@ static void ThrowExceptionHelper(Thread* thread, |
| &handler_sp, |
| &handler_fp, |
| &handler_needs_stacktrace); |
| + if (handler_pc == 0) { |
| + // No Dart frame. |
| + ASSERT(!thread->IsMutatorThread()); |
|
rmacnak
2016/09/13 23:29:56
Maybe assert that incoming_exception is the preall
Florian Schneider
2016/09/14 00:13:21
Done.
|
| + const UnhandledException& error = UnhandledException::Handle( |
| + zone, isolate->object_store()->preallocated_unhandled_exception()); |
| + thread->long_jump_base()->Jump(1, error); |
| + UNREACHABLE(); |
| + } |
| if (handler_needs_stacktrace) { |
| BuildStackTrace(&frame_builder); |
| } |