File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -143,13 +143,15 @@ computeMallocTypeSummary(const HeapMetadata *heapMetadata) {
143143 summary.type_kind = MALLOC_TYPE_KIND_SWIFT;
144144
145145 bool isGenericData = true ;
146- for (auto &field : *typeDesc->Fields .get ()) {
147- if (field.isIndirectCase ()) {
148- isGenericData = false ;
149- if (field.isVar ())
150- summary.layout_semantics .data_pointer = true ;
151- else
152- summary.layout_semantics .immutable_pointer = true ;
146+ if (auto *fieldDesc = typeDesc->Fields .get ()) {
147+ for (auto &field : *fieldDesc) {
148+ if (field.isIndirectCase ()) {
149+ isGenericData = false ;
150+ if (field.isVar ())
151+ summary.layout_semantics .data_pointer = true ;
152+ else
153+ summary.layout_semantics .immutable_pointer = true ;
154+ }
153155 }
154156 }
155157
You can’t perform that action at this time.
0 commit comments