Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: runtime/vm/object.cc

Issue 2005423002: Fix flaky test failure: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index b4ab952bf2dd79666937d77e737a2a5c395ab4e5..eb7ea15dd537b76230aaa7676c23d8b726d202d7 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -15246,16 +15246,17 @@ bool Instance::CheckAndCanonicalizeFields(Thread* thread,
// other instances to be canonical otherwise report error (return false).
Zone* zone = thread->zone();
Object& obj = Object::Handle(zone);
- intptr_t end_field_offset = SizeFromClass() - kWordSize;
- for (intptr_t field_offset = 0;
- field_offset <= end_field_offset;
- field_offset += kWordSize) {
- obj = *this->FieldAddrAtOffset(field_offset);
+ const intptr_t instance_size = SizeFromClass();
+ ASSERT(instance_size != 0);
+ for (intptr_t offset = Instance::NextFieldOffset();
+ offset < instance_size;
+ offset += kWordSize) {
+ obj = *this->FieldAddrAtOffset(offset);
if (obj.IsInstance() && !obj.IsSmi() && !obj.IsCanonical()) {
if (obj.IsNumber() || obj.IsString()) {
obj = Instance::Cast(obj).CheckAndCanonicalize(thread, NULL);
ASSERT(!obj.IsNull());
- this->SetFieldAtOffset(field_offset, obj);
+ this->SetFieldAtOffset(offset, obj);
} else {
ASSERT(error_str != NULL);
char* chars = OS::SCreate(zone, "field: %s\n", obj.ToCString());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698