mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
[ VM ] Fix issue where Field::RecordStore was attempting to record a sentinel for non-initialized late fields.
Change-Id: If77b39765e025989f83ef5f689b723984878df0a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134803 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
parent
8f5b1ea9bb
commit
d4a1a474d8
|
@ -10060,6 +10060,9 @@ void Field::RecordStore(const Object& value) const {
|
|||
return;
|
||||
}
|
||||
|
||||
// We should never try to record a sentinel.
|
||||
ASSERT(value.raw() != Object::sentinel().raw());
|
||||
|
||||
if ((guarded_cid() == kDynamicCid) ||
|
||||
(is_nullable() && value.raw() == Object::null())) {
|
||||
// Nothing to do: the field is not guarded or we are storing null into
|
||||
|
|
|
@ -631,7 +631,8 @@ RawObject* SnapshotReader::ReadInstance(intptr_t object_id,
|
|||
pobj_ = ReadObjectImpl(read_as_reference);
|
||||
result->SetFieldAtOffset(offset, pobj_);
|
||||
if ((offset != type_argument_field_offset) &&
|
||||
(kind_ == Snapshot::kMessage) && isolate()->use_field_guards()) {
|
||||
(kind_ == Snapshot::kMessage) && isolate()->use_field_guards() &&
|
||||
(pobj_.raw() != Object::sentinel().raw())) {
|
||||
// TODO(fschneider): Consider hoisting these lookups out of the loop.
|
||||
// This would involve creating a handle, since cls_ can't be reused
|
||||
// across the call to ReadObjectImpl.
|
||||
|
|
Loading…
Reference in a new issue