Chromium Code Reviews| Index: src/frames.cc |
| diff --git a/src/frames.cc b/src/frames.cc |
| index dfaf3ca5e4d6e838caf31913e62d46ec88375f10..5297bbbbe5a08ce627e4d85a55808ac9d55b6d1d 100644 |
| --- a/src/frames.cc |
| +++ b/src/frames.cc |
| @@ -121,15 +121,15 @@ StackFrame* StackFrameIteratorBase::SingletonFor(StackFrame::Type type, |
| StackFrame* StackFrameIteratorBase::SingletonFor(StackFrame::Type type) { |
| #define FRAME_TYPE_CASE(type, field) \ |
| - case StackFrame::type: result = &field##_; break; |
| + case StackFrame::type: \ |
| + return &field##_; |
| - StackFrame* result = NULL; |
| switch (type) { |
| case StackFrame::NONE: return NULL; |
| STACK_FRAME_TYPE_LIST(FRAME_TYPE_CASE) |
| default: break; |
| } |
| - return result; |
| + return NULL; |
| #undef FRAME_TYPE_CASE |
| } |
| @@ -234,7 +234,7 @@ SafeStackFrameIterator::SafeStackFrameIterator( |
| } |
| if (SingletonFor(type) == NULL) return; |
| frame_ = SingletonFor(type, &state); |
| - if (frame_ == NULL) return; |
| + DCHECK(frame_); |
|
titzer
2016/01/27 08:29:00
Did you run this through the trybots yet? I might
alph
2016/01/27 17:37:14
AFAICT it cannot return NULL if the previous call
|
| Advance(); |
| @@ -272,8 +272,12 @@ void SafeStackFrameIterator::AdvanceOneFrame() { |
| // Advance to the previous frame. |
| StackFrame::State state; |
| StackFrame::Type type = frame_->GetCallerState(&state); |
| + if (SingletonFor(type) == NULL) { |
|
yurys
2016/01/26 23:55:57
Maybe if (type < 0 || type >= StackFrame::NUMBER_O
alph
2016/01/27 00:19:36
I like mine more. Moreover it is used elsewhere (l
yurys
2016/01/27 00:22:14
Acknowledged.
|
| + frame_ = NULL; |
| + return; |
| + } |
| frame_ = SingletonFor(type, &state); |
| - if (frame_ == NULL) return; |
| + DCHECK(frame_); |
| // Check that we have actually moved to the previous frame in the stack. |
| if (frame_->sp() < last_sp || frame_->fp() < last_fp) { |