Fix stack walking when top frame has null method pointer.
Changed the do-while loop to just a while loop in the stack walk. This
fixes the case where the top frame has a null method pointer, which can
happen during instrumentation.
Change-Id: If7d67cd315d31bac4c1bbe31d6e385612b182935
diff --git a/src/stack.cc b/src/stack.cc
index e962dec..228f96d 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -221,7 +221,7 @@
// Can't be both a shadow and a quick fragment.
DCHECK(current_fragment->GetTopShadowFrame() == NULL);
AbstractMethod* method = *cur_quick_frame_;
- do {
+ while (method != NULL) {
SanityCheckFrame();
bool should_continue = VisitFrame();
if (UNLIKELY(!should_continue)) {
@@ -253,7 +253,7 @@
cur_quick_frame_ = reinterpret_cast<AbstractMethod**>(next_frame);
cur_depth_++;
method = *cur_quick_frame_;
- } while (method != NULL);
+ }
} else if (cur_shadow_frame_ != NULL) {
do {
SanityCheckFrame();