[vm] Fix CheckForPointers to not ignore ranges of size 1.
TEST=ci Change-Id: Id25b4ef224cd7c6ecf142b31311f51378366457d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200529 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
6815d1922a
commit
b42260dc34
@@ -18838,7 +18838,7 @@ class CheckForPointers : public ObjectPointerVisitor {
|
||||
bool has_pointers() const { return has_pointers_; }
|
||||
|
||||
void VisitPointers(ObjectPtr* first, ObjectPtr* last) {
|
||||
if (first != last) {
|
||||
if (last >= first) {
|
||||
has_pointers_ = true;
|
||||
}
|
||||
}
|
||||
@@ -18846,7 +18846,7 @@ class CheckForPointers : public ObjectPointerVisitor {
|
||||
void VisitCompressedPointers(uword heap_base,
|
||||
CompressedObjectPtr* first,
|
||||
CompressedObjectPtr* last) {
|
||||
if (first != last) {
|
||||
if (last >= first) {
|
||||
has_pointers_ = true;
|
||||
}
|
||||
}
|
||||
@@ -18882,8 +18882,9 @@ void Instance::CanonicalizeFieldsLocked(Thread* thread) const {
|
||||
} else {
|
||||
#if defined(DEBUG)
|
||||
// Make sure that we are not missing any fields.
|
||||
CheckForPointers has_pointers(IsolateGroup::Current());
|
||||
this->ptr()->untag()->VisitPointers(&has_pointers);
|
||||
IsolateGroup* group = IsolateGroup::Current();
|
||||
CheckForPointers has_pointers(group);
|
||||
this->ptr()->untag()->VisitPointersPrecise(group, &has_pointers);
|
||||
ASSERT(!has_pointers.has_pointers());
|
||||
#endif // DEBUG
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ intptr_t UntaggedObject::VisitPointersPredefined(ObjectPointerVisitor* visitor,
|
||||
void UntaggedObject::VisitPointersPrecise(IsolateGroup* isolate_group,
|
||||
ObjectPointerVisitor* visitor) {
|
||||
intptr_t class_id = GetClassId();
|
||||
if (class_id < kNumPredefinedCids) {
|
||||
if ((class_id != kInstanceCid) && (class_id < kNumPredefinedCids)) {
|
||||
VisitPointersPredefined(visitor, class_id);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user