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

stage2: fix miscompilations for peer expressions any time they needed coercions to runtime types #11958

Merged
merged 4 commits into from
Jun 29, 2022

Conversation

andrewrk
Copy link
Member

Revert "AstGen: preserve inferred ptr result loc for breaks"

This reverts commit 8bf3e1f, which
introduced miscompilations for peer expressions any time they needed
coercions to runtime types.

I opened #11957 as a proposal to accomplish the goal of the reverted
commit.

Closes #11898

Additional commits:

  • print_zir: fix unreachable missing end paren
  • Sema: fix not propagating want_safety in zirBlock. Before, @setRuntimeSafety() had no effect inside an if expression.
  • TypedValue: fix print function for optional_payload_ptr and eu_payload_ptr.

andrewrk added 3 commits June 28, 2022 16:35
for optional_payload_ptr and eu_payload_ptr
Before this commit, `@setRuntimeSafety()` has no effect inside an if
expression.
@andrewrk andrewrk requested a review from Vexu June 29, 2022 01:28
This reverts commit 8bf3e1f, which
introduced miscompilations for peer expressions any time they needed
coercions to runtime types.

I opened #11957 as a proposal to accomplish the goal of the reverted
commit.

Closes #11898
@andrewrk andrewrk force-pushed the store-to-inferred-ptr branch from 7fb64e2 to c3ae909 Compare June 29, 2022 01:38
Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like the proposal would also fix #11812, it would also likely have some of the same benefits as the special try instruction.

@andrewrk andrewrk merged commit 98681b2 into master Jun 29, 2022
@andrewrk andrewrk deleted the store-to-inferred-ptr branch June 29, 2022 18:26
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.

Stage2: simple if expression randomly has wrong result when safety checks are enabled
2 participants