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 Issue 21479 - ternary operator returns wrong val with ref return #12027

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Dec 14, 2020

The !f.isref path was optimizing the return expression, but this was not happening for ref returns. This led to manifest constant variables being leaked to the code generator, which may not necessarily know what to do with them.

@dlang-bot
Copy link
Contributor

dlang-bot commented Dec 14, 2020

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
21479 critical ternary operator returns wrong val with ref return

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#12027"

@thewilsonator
Copy link
Contributor

please target stable.

@ibuclaw ibuclaw changed the base branch from master to stable December 15, 2020 00:07
@thewilsonator
Copy link
Contributor

nfi why windows is failing.

@thewilsonator thewilsonator merged commit d0b16ff into dlang:stable Dec 15, 2020
@ibuclaw ibuclaw deleted the issue21479 branch December 15, 2020 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants