-
Notifications
You must be signed in to change notification settings - Fork 127
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
Handling of byref return values and locals in data flow analysis #2158
Comments
We will also need to ensure that this works correctly in the analyzer, as mentioned in #2390 (comment). Let's use this as a tracking issue for both the linker and the analyzer work. |
Does it really affect dataflow direction? There's just some C# language level restrictions/relaxations for each, but I think the data flows the same way (e.g. for For the formatting as |
I must admit I haven't spent too much time thinking about this (recently, I did when creating this issue :-)). I looked into it a bit more and I think you're right. There's probably no backward data flow necessary, but there are holes in the analysis. |
Regarding the formatting - so far most of the formatting has been copying C# syntax. The tool is IL and so the reflection syntax would be natural fit, on the other hand, I suspect that lot of developers will be confused by it. That said, for the by ref it's probably not as important (should be very rare). |
This issue is now tracking all the various cases of
ref
locals and return values for both the linker an analyzer.It's referred to from some tests, so just search the codebase for the issue number to find some of the known cases where it's problematic (definitely not all).
We will need to think this through, how the system should work around byref values.
In a way handling of byref values needs to effectively work "in reverse". Meaning that we need to enforce when assigning to a byref value that the byref value has at least the same annotations as the source value. But then assigning a known type needs to apply annotations from the byref to the type... so it's like writing to an annotated field.
There's also a reflection based test which also needs to correctly warn:
The text was updated successfully, but these errors were encountered: