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

Fix compiler crash when an if block ends with an assignment that has no result value. #3670

Conversation

jemc
Copy link
Member

@jemc jemc commented Oct 1, 2020

This fixes a compiler crash that used to occur when certain kinds of assignment expressions that have no logical result value were used as the last expression in an if block, and possibly other control flow constructs as well. Now the compiler makes sure that the code generation for those cases always bears a value, even though the type system guarantees that the value will never be used in such a case. This prevents generating invalid LLVM IR blocks that have no proper terminator instruction.

…no result value

This release fixes a compiler crash that used to occur when certain kinds of assignment expressions that have no logical result value were used as the last expression in an `if` block, and possibly other control flow constructs as well. Now the compiler makes sure that the code generation for those cases always bears a value, even though the type system guarantees that the value will never be used in such a case. This prevents generating invalid LLVM IR blocks that have no proper terminator instruction.
@jemc jemc self-assigned this Oct 1, 2020
@jemc jemc added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Oct 1, 2020
@mfelsche
Copy link
Contributor

mfelsche commented Oct 1, 2020

Hmm... this segfaults on stdlib tests on arm-linux-gnueabihf-gcc. I restarted that particular job to see if it persists.

@SeanTAllen SeanTAllen merged commit a675f55 into master Oct 1, 2020
@SeanTAllen SeanTAllen deleted the fix/3669-control-block-ending-with-assignment-with-no-result-value branch October 1, 2020 11:38
github-actions bot pushed a commit that referenced this pull request Oct 1, 2020
github-actions bot pushed a commit that referenced this pull request Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants