Avoid crash in HeapChunkContext::Flush post Reset.
Port to ART of 22d8dba8ae5be7aecb07322a410712206896fa15.
Change-Id: I74445f2aac22a037533f13aa894ae4f6cea1abc9
diff --git a/src/debugger.cc b/src/debugger.cc
index 49c29ba..cdc2178 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -3182,6 +3182,11 @@
}
void Flush() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ if (pieceLenField_ == NULL) {
+ // Flush immediately post Reset (maybe back-to-back Flush). Ignore.
+ CHECK(needHeader_);
+ return;
+ }
// Patch the "length of piece" field.
CHECK_LE(&buf_[0], pieceLenField_);
CHECK_LE(pieceLenField_, p_);