Skip to content
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

[SR-13490] compareImports() in ModuleInterfacePrinting.cpp looks buggy #55932

Closed
beccadax opened this issue Sep 3, 2020 · 2 comments · Fixed by #34095
Closed

[SR-13490] compareImports() in ModuleInterfacePrinting.cpp looks buggy #55932

beccadax opened this issue Sep 3, 2020 · 2 comments · Fixed by #34095
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers swift 5.3 textual interfaces unexpected behavior Bug: Unexpected behavior or incorrect output

Comments

@beccadax
Copy link
Contributor

beccadax commented Sep 3, 2020

Previous ID SR-13490
Radar rdar://problem/68295662
Original Reporter @beccadax
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, ParseableInterfaces, StarterBug
Assignee interfere (JIRA)
Priority Medium

md5: 97cef930f2abbe7b555cc59e458e7f87

Issue Description:

The helper function compareImports() in ModuleInterfacePrinting.cpp attempts to compare two ImportDecls by their import paths (the dotted identifiers in them) to sort them into a stable order, but if the two import paths have different numbers of identifiers, it looks like it will consider them equal.

I don't have a test case that will actually cause buggy behavior, so you will need to:

1\ Read the code around it to figure out how it is used.
2. Devise a test case that will cause visibly buggy behavior.
3. Actually fix the bug.

I noticed this while working on a large pull request that touches this code; please wait until I've landed that to fix this bug.

@typesanitizer
Copy link

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Alexey Komnin (JIRA)

PR --> #34095

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added textual interfaces swift 5.3 unexpected behavior Bug: Unexpected behavior or incorrect output and removed ParseableInterfaces labels Oct 24, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers swift 5.3 textual interfaces unexpected behavior Bug: Unexpected behavior or incorrect output
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants