Chromium Code Reviews| Index: vm/exceptions.cc |
| =================================================================== |
| --- vm/exceptions.cc (revision 12412) |
| +++ vm/exceptions.cc (working copy) |
| @@ -32,7 +32,11 @@ |
| const GrowableObjectArray& pc_offset_list) { |
| StackFrameIterator frames(StackFrameIterator::kDontValidateFrames); |
| StackFrame* frame = frames.NextFrame(); |
| - ASSERT(frame != NULL); |
| + if (frame == NULL) { |
| + // We have no dart invocation frames and hence cannot find a handler |
| + // to return to. |
| + return false; |
| + } |
| Function& func = Function::Handle(); |
| Code& code = Code::Handle(); |
| Smi& offset = Smi::Handle(); |
| @@ -157,6 +161,16 @@ |
| func_list, |
| code_list, |
| pc_offset_list); |
| + if (handler_pc == 0) { |
| + // There are no dart invocation frames on the stack we do not |
|
cshapiro
2012/09/15 03:45:31
Might be missing a word. How about "so we" rather
siva
2012/10/09 19:01:52
Done.
|
| + // have a caller to return to, this is a case where we would have |
|
cshapiro
2012/09/15 03:45:31
This seems like 2 sentences. How about a period i
siva
2012/10/09 19:01:52
Done.
siva
2012/10/09 19:01:52
Done.
|
| + // to call the Isolate error handler and let it deal with the shutdown. |
| + // We report an error and shutdown the process as a temporary solution |
| + // until the isolate error handler stuff is implemented. |
| + ASSERT(!handler_exists); |
| + OS::Print("Exception '%s' thrown:\n", exception.ToCString()); |
|
cshapiro
2012/09/15 03:45:31
Why not OS::PrintErr? Maybe note that we are exit
siva
2012/10/09 19:01:52
Done.
|
| + OS::Exit(255); |
|
cshapiro
2012/09/15 03:45:31
Just a thought: this is not the first place where
siva
2012/10/09 19:01:52
Agree, that would work for exits from the VM but t
|
| + } |
| // 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. |