Skip to content

Commit 4577136

Browse files
committed
[lldb] Fix reading duplicate objc class metdata from shared cache (llvm#167405)
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 (cherry picked from commit 4d27413)
1 parent 9b056f2 commit 4577136

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
@@ -542,7 +542,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
542542
543543
for (uint32_t i=0; i<duplicate_count; ++i)
544544
{
545-
const uint64_t objectCacheOffset = classOffsets[i].objectCacheOffset;
545+
const uint64_t objectCacheOffset = duplicateClassOffsets[i].objectCacheOffset;
546546
DEBUG_PRINTF("objectCacheOffset[%u] = %u\n", i, objectCacheOffset);
547547
548548
if (classOffsets[i].isDuplicate) {
@@ -581,6 +581,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
581581
}
582582
class_infos[idx].hash = h;
583583
}
584+
++idx;
584585
}
585586
}
586587
else if (objc_opt->version >= 12 && objc_opt->version <= 15)

0 commit comments

Comments
 (0)