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
Harden ParseEmbeddedStatement #13924
Conversation
CC @dotnet/roslyn-compiler |
@@ -2623,6 +2623,40 @@ static void Test(int arg1, (byte, byte) arg2) | |||
Assert.Equal(false, tree.GetRoot().ContainsDiagnostics); | |||
} | |||
|
|||
[Fact] | |||
[WorkItem(684860, "https://devdiv.visualstudio.com/DevDiv/_workitems/edit/266237")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[WorkItem(266237, ...)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh 😦
LGTM |
The consumers of ParseEmbeddedStatement depend on it having a non-null return. Yet it directly returns the result of ParseStatementCore which can validly return null values in error conditions. In the case that does happen return an empty statement with a diagnostic.
LGTM |
1 similar comment
LGTM |
https://devdiv.visualstudio.com/DevDiv/_workitems?_a=edit&id=266237&triage=true Here is that callstack:
|
The consumers of ParseEmbeddedStatement depend on it having a non-null return. Yet it directly returns the result of ParseStatementCore which can validly return null values in error conditions. In the case that does happen return an empty statement with a diagnostic.