Verify that heap object iterator stays within page bound.
authorhpayer <hpayer@chromium.org>
Thu, 8 Jan 2015 14:45:14 +0000 (06:45 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 8 Jan 2015 14:45:28 +0000 (14:45 +0000)
BUG=

Review URL: https://codereview.chromium.org/823583010

Cr-Commit-Position: refs/heads/master@{#25999}

src/heap/spaces-inl.h

index d81d253e1b214e89ab2f4d6664f931cdc9c1d5b2..9cb292e3df4adfdf53e3b716560df5399479cc43 100644 (file)
@@ -91,6 +91,12 @@ HeapObject* HeapObjectIterator::FromCurrentPage() {
     int obj_size = (size_func_ == NULL) ? obj->Size() : size_func_(obj);
     cur_addr_ += obj_size;
     DCHECK(cur_addr_ <= cur_end_);
+    // TODO(hpayer): Remove the debugging code.
+    if (cur_addr_ > cur_end_) {
+      space_->heap()->isolate()->PushStackTraceAndDie(0xaaaaaaaa, obj, NULL,
+                                                      obj_size);
+    }
+
     if (!obj->IsFiller()) {
       DCHECK_OBJECT_SIZE(obj_size);
       return obj;