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-14123] [memory-lifetime] Needs to handle switch_enum_addr so we can re-enable it on enum typed allocations #56504

Open
gottesmm opened this issue Jan 28, 2021 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@gottesmm
Copy link
Member

Previous ID SR-14123
Radar rdar://problem/73770085
Original Reporter @gottesmm
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @eeckstein
Priority Medium

md5: 2436e5877a24365c91c8628c7bd24452

Issue Description:

In this PR: #35606 I am
disabling the memory lifetime verifier from running on
allocations that are enum typed. The reason that I am doing this
is that currently in this verifier, we stop verifying if we find
a switch_enum_addr use. This creates a problem since no one has
gone through and changed the frontend/optimizer to understand
that it needs to insert destroy_addr on alloc_stack even if
dynamically we know that the enum has a trivial case or
non-payloaded case due to a switch_enum_addr. So if one then
performs the completely unrelated, valid optimization of
promoting the switch_enum_addr to a switch_enum (lets say using a
load_borrow), then this verifier will see a leaked value along
the non-payloaded path.

We should fully implement support for enums in this verifier and re-enable it![]( Memory Lifetime correctness is important)

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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
Projects
None yet
Development

No branches or pull requests

2 participants