-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Switch back to the old mangling for ObjC runtime names. #9359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch back to the old mangling for ObjC runtime names. #9359
Conversation
@swift-ci Please test |
lib/Demangling/OldRemangler.cpp
Outdated
} | ||
|
||
void Remangler::mangleProtocolListWithClass(Node *node) { | ||
Out << "<procotol-list-with-class>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means if you have a GenericClass<P & C>
, we're going to mangle it with an invalid mangling containing "procotol-list-with-class" (sic)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that must be fixed
lib/Demangling/OldRemangler.cpp
Outdated
} | ||
|
||
void Remangler::mangleProtocolListWithAnyObject(Node *node) { | ||
Out << "<procotol-list-with-any-object>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause problems down the line also, when master is merged into 4.0 branch next time, and the user has a generic objc class with a generic parameter set to AnyObject.
It sounds like we'll have to invent new "old-style" manglings for any new mangling nodes that were added after the new mangling became the default. Gross. |
Only for nodes which are created in stdlib/public/runtime/Demangle.cpp |
Right, but that includes the two node kinds I pointed out above. Until we do that, do you mind adding asserts to the new node kind cases, instead of returning bogus strings, so we can be sure that nobody will accidentally mangle those in the meantime? |
sure |
f849037
to
3c66c07
Compare
@swift-ci Please test |
Build failed |
@slavapestov I fixed the mangling of those 2 nodes. Can you please review the PR for swift-4.0? |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but you might want to fix AnyObject mangling to match the old behavior also.
lib/Demangling/OldRemangler.cpp
Outdated
|
||
void Remangler::mangleProtocolListWithAnyObject(Node *node) { | ||
Out << "Xl"; | ||
mangleProtocolListWithoutPrefix(node->getChild(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but this is still wrong
@slavapestov This is the fix (on master): #9410 |
To be backward compatible to existing archives created by the NSKeyedArchiver
…ted at runtime. To be backward compatible to existing archives created by the NSKeyedArchiver for generic classes
Check that we can read an archive which was produced with the swift 3.1 compiler
…ss and ProtocolListWithAnyObject nodes
…e swift 3 mangling
90009e4
to
d56d897
Compare
@slavapestov I updated this PR with the fix for AnyObject |
@swift-ci Please test |
Build failed |
Build failed |
Explanation: This gives us backward compatibility for existing NSKeyedArchives for all kind of classes: private, non-top-level, generic classes.
Scope: This is a change which is needed to prevent user data loss.
Issue: rdar://problem/32027951
Risk: Low. We used those runtime names also in the swift 3.1 compiler
Testing: There is a test case in this PR for swift CI