Skip to content

[6.1][IRGen] Apply correct type to conversion for direct values and erorrs… #79370

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 1 commit into from
Feb 14, 2025

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Feb 13, 2025

… with typed throws

  • Explanation: When converting the combined result back to the actual types when directly returning typed errors, in case the error or result value was a single value smaller then pointer size and the combined value was larger, the value was converted to the combined type instead of the actual type, making it a no-op, which caused undefined behavior when writing the value to the coerced alloca.
  • Scope: Typed throws ABI
  • Issues: rdar://144719032
  • Original PRs: [IRGen] Apply correct type to conversion for direct values and erorrs… #79369
  • Risk: Low. The change is simple, well understood and tested.
  • Testing: Added regression tests for the problematic patterns and existing tests still pass.
  • Reviewers: @aschwaighofer

… with typed throws

rdar://144719032

When converting the combined result back to the actual types when directly returning typed errors, in case
the error or result value was a single value smaller then pointer size and the combined value was larger,
the value was converted to the combined type instead of the actual type, making it a no-op, which caused
undefined behavior when writing the value to the coerced alloca.
@drexin drexin requested a review from a team as a code owner February 13, 2025 21:04
@drexin
Copy link
Contributor Author

drexin commented Feb 13, 2025

@swift-ci test

@drexin drexin changed the title [IRGen] Apply correct type to conversion for direct values and erorrs… [6.1][IRGen] Apply correct type to conversion for direct values and erorrs… Feb 13, 2025
@drexin drexin added the 🍒 release cherry pick Flag: Release branch cherry picks label Feb 13, 2025
@drexin drexin merged commit a4f13dc into swiftlang:release/6.1 Feb 14, 2025
5 checks passed
@drexin drexin deleted the wip-144719032-6.1 branch February 14, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants