Skip to content

Conversation

@mattgallagher
Copy link
Contributor

What's in this pull request?

This is a fix for an apparent typo affecting demangling and remangling of @unowned_inner_pointer. This bug was discovered while exploring lib/basic/Demangle.cpp (it did not occur during testing – so it's not obviously a serious problem) but the fixed logic appears to be valid according to doc/AST.rst. I've added test cases to test/Demangle/Inputs/manglings.txt to exercise the code path (these cases are duplicates of the preceding "@unowned" result tests, changed to be "@unowned_inner_pointer").

Curiously, I had to add a corresponding fix to lib/Basic/Remangle.cpp to allow "swift-demangle -test-remangle" to pass. I assume it's coincidence or convergent evolution that caused both Demangle.cpp and Remangle.cpp to have the same typo – but there's a possibility there's something else going on that I don't know about (if so, then the comment in Demangle.cpp and AST.rst are incorrect).

Resolved bug number: [none]

This is not associated with any bug.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

Fixed an apparent typo where two cases tested for the same lowercase 'd' pattern, resulting in one case never being used. According to the comment block, doc/ABI.rst and lib/AST/Mangle.cpp, the second case should be an uppercase 'D'.
Changed 'd' to 'D' to match corresponding fix in Demangle.cpp.
Corresponds to fix in Demangle.cpp
Corresponding to fix in Demangle.cpp.
@mattgallagher mattgallagher changed the title Mattgallagher demangle typo fix Demangle typo fix Apr 28, 2016
@mattgallagher mattgallagher changed the title Demangle typo fix Demangle unowned_inner_pointer fix Apr 28, 2016
@mattgallagher mattgallagher changed the title Demangle unowned_inner_pointer fix Demangle @unowned_inner_pointer fix Apr 28, 2016
@rjmccall
Copy link
Contributor

I think I was just following the Demangle implementation in Remangle. LGTM.

@rjmccall rjmccall merged commit 16a8759 into swiftlang:master Apr 28, 2016
MaxDesiatov pushed a commit that referenced this pull request Apr 19, 2021
[pull] swiftwasm from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants