Skip to content

Conversation

kerams
Copy link
Contributor

@kerams kerams commented Mar 27, 2023

Fixes #13386.

The problem turned out not to be the initobj for TaskAwaiter, but the fact that the code emitted by task builder relies on locals being initialized. Randomly initialized bool flags could result in semi-arbitrary code being executed, like an exception handler despite no exception being thrown.

An alternative solution would have been to manually initialize every local used by the state machine in MoveNext, enabling user code, which is inlined, to potentially benefit from no initialization.

@kerams kerams requested a review from a team as a code owner March 27, 2023 18:33
Copy link
Member

@vzarytovskii vzarytovskii left a comment

Choose a reason for hiding this comment

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

Awesome!

@psfinaki
Copy link
Contributor

Thanks @kerams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

NRE in task builder with SkipLocalsInit after certain amount of invocations in Release

3 participants