Skip to content

Commit a450a84

Browse files
committed
[lldb] Fix reading duplicate objc class metdata from shared cache
The code for v16 of the shared cache objc class layout was copy/pasted from the previous versions incorrectly. Namely, the wrong class offset list was used and the class_infos index was never updated. rdar://164430695
1 parent 6d18313 commit a450a84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
537537
538538
for (uint32_t i=0; i<duplicate_count; ++i)
539539
{
540-
const uint64_t objectCacheOffset = classOffsets[i].objectCacheOffset;
540+
const uint64_t objectCacheOffset = duplicateClassOffsets[i].objectCacheOffset;
541541
DEBUG_PRINTF("objectCacheOffset[%u] = %u\n", i, objectCacheOffset);
542542
543543
if (classOffsets[i].isDuplicate) {
@@ -576,6 +576,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
576576
}
577577
class_infos[idx].hash = h;
578578
}
579+
++idx;
579580
}
580581
}
581582
else if (objc_opt->version >= 12 && objc_opt->version <= 15)

0 commit comments

Comments
 (0)