Skip to content

Fix SILGen ManagedValue::isPlusOne for addresses #65579

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
merged 3 commits into from
May 3, 2023

Conversation

atrick
Copy link
Contributor

@atrick atrick commented May 2, 2023

Fix ManagedValue::isPlusOne for addresses

In-memory values cannot be reused after deinitialization.

Add ManagedValue::isPlusOneOrTrivial() for situations where we want to
forward a value without destroying the original memory.

Fixes rdar://108001491 (SIL verification failed: Found mutating or
consuming use of an in_guaranteed parameter?!:
!ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg))

atrick added 3 commits May 1, 2023 23:23
In-memory values cannot be reused after deinitialization.

Add ManagedValue::isPlusOneOrTrivial() for situations where we want to
forward a value without destroying the original memory.

Fixes rdar://108001491 (SIL verification failed: Found mutating or
consuming use of an in_guaranteed parameter?!:
!ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg))
Whenever we want to forward to a +1 value but don't need to destroy
the original memory, use isPlusOneOrTrivial.

This follows the existing naming scheme.

Fixes rdar://108001491 (SIL verification failed: Found mutating or
consuming use of an in_guaranteed parameter?!:
!ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg))
Tests rdar://108001491 (SIL verification failed: Found mutating
or consuming use of in_guaranteed parameter?!: !ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg))
@atrick
Copy link
Contributor Author

atrick commented May 2, 2023

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented May 2, 2023

@swift-ci test source compatibility

@atrick
Copy link
Contributor Author

atrick commented May 2, 2023

@swift-ci benchmark

@atrick
Copy link
Contributor Author

atrick commented May 2, 2023

Appeared to have a connection failure when running Swift driver tests after all regular tests passed.

@atrick
Copy link
Contributor Author

atrick commented May 2, 2023

@swift-ci test macOS Platform

@atrick atrick merged commit 2b019d8 into swiftlang:main May 3, 2023
@atrick atrick deleted the fix-silgen-consume branch May 3, 2023 16:30
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