-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 check for types interesting to dataflow #105642
Conversation
[UnexpectedWarning ("IL2067", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/101211")] | ||
static unsafe void RequirePublicMethods ( | ||
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] | ||
Type* typePtr) |
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.
Just to make sure I understand what's going on here: we do not consider pointers of Type
to be interesting, right? Or is #101211 saying that we shouldn't be doing that, but we are?
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.
Type*
should not be considered for dataflow analysis. All the tools correctly report IL2098 due to invalid annotations on uninteresting Type*
.
#101211 is about the analyzer still considering Type*
in dataflow analysis, and incorrectly reporting IL2067 about annotations on typePtr
mismatching the requirements of RequirePublicFields
. Basically the IsTypeInterestingForDataflow
check isn't wired up correctly in the analyzer, so it only impacts the IL2098 warnings, not the dataflow warnings.
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.
LGTM, thanks!
/ba-g "Helix work item dead-lettered" |
This makes the check
IsTypeInterestingForDataflow
more consistent across ILLink/ILC/analyzer.Fixes #104761, and fixes analyzer behavior for byrefs of string.
@dotnet/appmodel PTAL