[vm] Fix initialization of Contexts in object graph copy's fast-path bailout.
Cf. 179c96cd60993f39c299f173e15c32bbca4a8bbe.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/47235
Change-Id: I9f6aef564286f6b239d697072ed5405085269add
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213681
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/object_graph_copy.cc b/runtime/vm/object_graph_copy.cc
index 2853b37..45642c8 100644
--- a/runtime/vm/object_graph_copy.cc
+++ b/runtime/vm/object_graph_copy.cc
@@ -1795,9 +1795,13 @@
const intptr_t cid = UntaggedObject::ClassIdTag::decode(tags);
// External typed data is already initialized.
if (!IsExternalTypedDataClassId(cid) && !IsTypedDataViewClassId(cid)) {
+#if defined(DART_COMPRESSED_POINTERS)
+ const bool compressed = true;
+#else
+ const bool compressed = false;
+#endif
Object::InitializeObject(reinterpret_cast<uword>(to.untag()), cid,
- from.untag()->HeapSize(),
- /*compressed=*/cid != kContextCid);
+ from.untag()->HeapSize(), compressed);
UpdateLengthField(cid, from, to);
}
}