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

Zero init values on demand despite SkipLocalsInit being set #11688

Merged
merged 4 commits into from
Sep 6, 2021

Conversation

kerams
Copy link
Contributor

@kerams kerams commented Jun 17, 2021

Addresses #11267 (comment).

@dsyme, that leaves the byrefs.

@kerams
Copy link
Contributor Author

kerams commented Sep 6, 2021

@dsyme, can we move this forward?

I've just been bitten by this and spent some time investigating code similar to

[<System.Runtime.CompilerServices.SkipLocalsInitAttribute>]
let x f =
    let a  = if 1 / 1 = 1 then Nullable () else Nullable 5L
    printfn "%A" (f a)

Instead of Nullable () I was getting Nullable -4294967296L because of the missing initobj.

@dsyme
Copy link
Contributor

dsyme commented Sep 6, 2021

Our apologies, this should have been integrated

@dsyme dsyme enabled auto-merge (squash) September 6, 2021 18:43
@dsyme dsyme disabled auto-merge September 6, 2021 18:43
@dsyme dsyme closed this Sep 6, 2021
@dsyme dsyme reopened this Sep 6, 2021
@dsyme
Copy link
Contributor

dsyme commented Sep 6, 2021

@kerams could you add that as a test case to this PR? Many thanks

@dsyme dsyme merged commit 62683f1 into dotnet:main Sep 6, 2021
@dsyme
Copy link
Contributor

dsyme commented Sep 6, 2021

Thank you! It's great to have this fixed

@kerams kerams deleted the patch-0 branch September 6, 2021 21:52
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