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

Unified Diff: runtime/vm/object.cc

Issue 14298012: Fix for issue 9871 - Object::empty_array() returns a broken handle. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 21569)
+++ runtime/vm/object.cc (working copy)
@@ -497,8 +497,10 @@
// Allocate and initialize the empty_array instance.
{
uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
- *empty_array_ = reinterpret_cast<RawArray*>(address + kHeapObjectTag);
InitializeObject(address, kArrayCid, Array::InstanceSize(0));
+ Array::initializeHandle(
+ empty_array_,
+ reinterpret_cast<RawArray*>(address + kHeapObjectTag));
empty_array_->raw()->ptr()->length_ = Smi::New(0);
}
@@ -507,6 +509,16 @@
isolate->object_store()->set_bool_class(cls);
*bool_true_ = Bool::New(true);
*bool_false_ = Bool::New(false);
+ ASSERT(!empty_array_->IsSmi());
+ ASSERT(empty_array_->IsArray());
+ ASSERT(!sentinel_->IsSmi());
+ ASSERT(sentinel_->IsInstance());
+ ASSERT(!transition_sentinel_->IsSmi());
+ ASSERT(transition_sentinel_->IsInstance());
+ ASSERT(!bool_true_->IsSmi());
+ ASSERT(bool_true_->IsBool());
+ ASSERT(!bool_false_->IsSmi());
+ ASSERT(bool_false_->IsBool());
}
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698