Skip to content

Commit 21dd5d0

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fix assert in heap snapshot writer.
TEST=iso-stress Bug: #60701 Change-Id: I0e66fc1e9ce38eb566f68eddb63ebbe5e2200275 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428081 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 564444d commit 21dd5d0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

runtime/vm/object_graph.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ class ObjectSlots {
131131
// and be without holes (otherwise, e.g. if a slot was not declared,
132132
// the visitors will visit them but we won't emit the field description in
133133
// the heap snapshot).
134-
if (contains_only_tagged_words) {
135-
intptr_t expected_offset = kWordSize;
134+
if (contains_only_tagged_words && (slots->length() > 0)) {
135+
intptr_t expected_offset = (*slots)[0].offset;
136136
for (auto& slot : *slots) {
137-
RELEASE_ASSERT(slot.offset = expected_offset);
137+
ASSERT_EQUAL(slot.offset, expected_offset);
138138
expected_offset += kCompressedWordSize;
139139
}
140140
}

runtime/vm/raw_object_fields.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace dart {
2828
F(Class, constants_) \
2929
F(Class, declaration_type_) \
3030
F(Class, invocation_dispatcher_cache_) \
31+
F(Class, declaration_instance_type_arguments_) \
3132
F(PatchClass, wrapped_class_) \
3233
F(PatchClass, script_) \
3334
F(Function, name_) \
@@ -246,10 +247,11 @@ namespace dart {
246247
F(Class, direct_subclasses_)
247248

248249
#define JIT_CLASSES_AND_FIELDS(F) \
249-
F(Class, allocation_stub_) \
250-
F(Class, dependent_code_) \
251250
F(Class, direct_implementors_) \
252251
F(Class, direct_subclasses_) \
252+
F(Class, allocation_stub_) \
253+
F(Class, dependent_code_) \
254+
F(Library, kernel_program_info_) \
253255
F(Code, active_instructions_) \
254256
F(Code, deopt_info_array_) \
255257
F(Code, static_calls_target_table_) \

0 commit comments

Comments
 (0)