[lldb] Fix reading duplicate objc class metdata from shared cache#167405
Merged
[lldb] Fix reading duplicate objc class metdata from shared cache#167405
Conversation
Member
|
@llvm/pr-subscribers-lldb Author: Alex Langford (bulbazord) Changesrdar://164430695 Full diff: https://github.com/llvm/llvm-project/pull/167405.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 9beb133f5595f..9fff4adbff79d 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -537,7 +537,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
for (uint32_t i=0; i<duplicate_count; ++i)
{
- const uint64_t objectCacheOffset = classOffsets[i].objectCacheOffset;
+ const uint64_t objectCacheOffset = duplicateClassOffsets[i].objectCacheOffset;
DEBUG_PRINTF("objectCacheOffset[%u] = %u\n", i, objectCacheOffset);
if (classOffsets[i].isDuplicate) {
@@ -576,6 +576,7 @@ __lldb_apple_objc_v2_get_shared_cache_class_info (void *objc_opt_ro_ptr,
}
class_infos[idx].hash = h;
}
+ ++idx;
}
}
else if (objc_opt->version >= 12 && objc_opt->version <= 15)
|
JDevlieghere
approved these changes
Nov 10, 2025
Member
JDevlieghere
left a comment
There was a problem hiding this comment.
LGTM. Maybe try to add a little bit more context in the PR summary (e.g. that this was incorrectly copy/pasted when adding support for the v16 layout). Just listing the radar makes it seem like there might be more to it that external folks can't access.
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
7bda043 to
a450a84
Compare
bulbazord
added a commit
to swiftlang/llvm-project
that referenced
this pull request
Nov 13, 2025
…vm#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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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