summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-01-18 17:51:18 -0800
committer Ian Rogers <irogers@google.com> 2013-01-18 17:51:18 -0800
commitd636b0623307a379e255a9aaa682c12a2acc3a92 (patch)
treeac5a98eab337b23b6f14b750683b6540f8883166
parentd75afb99f0c8b8a27ad84e2e31010383ecf72120 (diff)
Avoid crash in HeapChunkContext::Flush post Reset.
Port to ART of 22d8dba8ae5be7aecb07322a410712206896fa15. Change-Id: I74445f2aac22a037533f13aa894ae4f6cea1abc9
-rw-r--r--src/debugger.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/debugger.cc b/src/debugger.cc
index 49c29ba98a..cdc2178341 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -3182,6 +3182,11 @@ class HeapChunkContext {
}
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_);