Skip to content

[SILVerifier] Add detection of conflicting debug variables #72397

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

Merged

Conversation

Snowy1803
Copy link
Member

IRGenDebugInfo assumes, using a cache, that all variables with the same scope, same name and same source location, are lowered to the same type. This assumption was broken in some rare cases. This PR fixes those cases and adds a SILVerifier assertion to detect them early.

rdar://124555787

@Snowy1803
Copy link
Member Author

@swift-ci please test source compatibility

@Snowy1803 Snowy1803 force-pushed the verifier-conflicting-debug-value-types branch 2 times, most recently from 83f7f1c to 0ad5044 Compare March 19, 2024 22:28
@Snowy1803
Copy link
Member Author

@swift-ci please test

@Snowy1803
Copy link
Member Author

@swift-ci please test source compatibility

@Snowy1803 Snowy1803 requested a review from adrian-prantl March 19, 2024 22:36
@adrian-prantl
Copy link
Contributor

looks like test/SILOptimizer/init_accessors.swift is triggering the check

For address-only types, a temporary was emitted with the same debug variable
and same scope as the instruction it is moved to after entering a shared case,
but it would have a different type, which would create a conflict.
The better way to fix this would probably to use a different scope for both,
but the variable is moved immediately anyway.
@Snowy1803 Snowy1803 force-pushed the verifier-conflicting-debug-value-types branch from 0ad5044 to 0162ccd Compare March 20, 2024 22:37
@Snowy1803 Snowy1803 force-pushed the verifier-conflicting-debug-value-types branch from 0162ccd to fed03cc Compare March 20, 2024 22:56
@Snowy1803
Copy link
Member Author

@swift-ci please smoke test

@adrian-prantl
Copy link
Contributor

@swift-ci test source compatibility

@adrian-prantl
Copy link
Contributor

@swift-ci test linux

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