Skip to content

[move-only] Ensure that if we have an allocation that isn't fully initialized (and DI errors on it as such), the move checkers do not run on the allocation. #65773

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

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented May 8, 2023

Previously we would crash.

The methodology here is that I added a flag to alloc_stack and alloc_box called had_di_error. DI if it emits an error on said alloc_stack/alloc_box will set the flag. If the move checker sees that flag then:

  1. It doesn't process the allocation.
  2. It acts as if it emitted an error meaning that it will eliminate the mark_must_check and convert any copies to non-asserting variants without emitting a "found a copy, please file a bug" error.

rdar://108993297

@gottesmm
Copy link
Contributor Author

gottesmm commented May 8, 2023

@swift-ci smoke test

@gottesmm gottesmm requested review from jckarter and kavon May 8, 2023 19:55
…tialized (and DI errors on it as such), the move checkers do not run on the allocation.

Previously we would crash.

Since we are relatively late in 5.9, my solution is to just turn off the move
checker on functions whenever DI would emit an error. If we were earlier in the
development cycle, then I would make the error be a per allocation change.

rdar://108993297
@gottesmm gottesmm force-pushed the pr-ca1d38387d2ede83e74c099e78e89c8eeaba81ba branch from c2541d5 to d413b24 Compare May 8, 2023 20:39
@gottesmm
Copy link
Contributor Author

gottesmm commented May 8, 2023

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented May 8, 2023

Made the change smaller/simpler so that I don't have to touch the module format.

@gottesmm
Copy link
Contributor Author

gottesmm commented May 8, 2023

@swift-ci smoke test

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