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

Unified Diff: runtime/vm/object.cc

Issue 634443002: Fix Object::Clone heap corruption under concurrent sweeping. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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
===================================================================
--- runtime/vm/object.cc (revision 40915)
+++ runtime/vm/object.cc (working copy)
@@ -1745,7 +1745,15 @@
intptr_t size = src.raw()->Size();
RawObject* raw_obj = Object::Allocate(cls.id(), size, space);
NoGCScope no_gc;
+ // Newly allocated objects are white ...
+ // TODO(koda): This will trip when we start allocating black.
+ // Update unmarking code below at that point.
+ ASSERT(!raw_obj->IsMarked());
memmove(raw_obj->ptr(), src.raw()->ptr(), size);
+ // ... so ensure clone is too (see issue 21236).
+ if (raw_obj->IsMarked()) {
+ raw_obj->ClearMarkBit();
+ }
if ((space == Heap::kOld) && !raw_obj->IsRemembered()) {
Ivan Posva 2014/10/06 05:18:53 We should discuss this condition in person. I am n
koda 2014/10/06 05:35:35 Agreed. In general, this method seems awfully tri
StoreBufferUpdateVisitor visitor(Isolate::Current(), raw_obj);
raw_obj->VisitPointers(&visitor);
« 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