Add fallback condition when adding a protocol to a subclass#94
Draft
L1ghtmann wants to merge 2 commits intotheos:masterfrom
Draft
Add fallback condition when adding a protocol to a subclass#94L1ghtmann wants to merge 2 commits intotheos:masterfrom
L1ghtmann wants to merge 2 commits intotheos:masterfrom
Conversation
uroboro
requested changes
Dec 26, 2022
Member
uroboro
left a comment
There was a problem hiding this comment.
If you use the "elvis" operator, you can reduce the number of calls to objc_getProtocol():
objc_getProtocol(\"$_\") ?: \@protocol($_)
Member
Author
Today I learned that's a thing. Thanks! |
uroboro
approved these changes
Dec 28, 2022
Member
Author
|
It appears this exact fix has been proposed on two separate occasions and both times Dustin pointed out potential problems that would need to be addressed: |
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.
What does this implement/fix? Explain your changes.
objc_getProtocolin%subclassas proposed by RPetrich in %subclass with protocols crashes in the constructor #9 (comment)Does this close any currently open issues?
Appears to resolve #9
Any relevant logs, error output, etc?
N/A
Any other comments?
With the following code (a modified version of the code mentioned in the issue above):
Current logos: crash
This branch: no crash
Where has this been tested?
Operating System: …
Linux (WSL)
iP7 -- iOS 14.3 - unc0ver
Platform: …
Target Platform: …
Toolchain Version: …
SDK Version: …