You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
[DAM analyzer] Don't produce dataflow warnings for annotations on invalid types #2598
When typeof(T).TypeHandle flows into an unannotated location, the linker and analyzer are both producing warnings about an unknown value failing to meet the DAM requirements. There are two problems here:
We shouldn't be producing warnings for unknown values when there are no requirements.
We aren't flowing annotations on T through get_TypeHandle. I think it would make sense to do this.
I think we should fix it by propagating the annotations from the generic parameter through get_TypeHandle.
I realized it doesn't make sense to propagate through get_TypeHandle because we don't support annotations on RuntimeTypeHandle. The current logic is ok because it will propagate the annotation if you do Type.GetTypeFromHandle(typeof(T).TypeHandle).
The issue we saw in runtime was just that we're producing a warning even though the target is an unsupported type for the annotations - which @tlakollo is working on as part of #2409. I'll leave this issue to track not producing dataflow warnings for unsupportred annotated locations (while the other issue tracks adding warnings for the invalid annotations).
changed the title [-][DAM analyzer] Analyzer and linker produce warning for generic parameter TypeHandle[/-][+][DAM analyzer] Don't produce dataflow warnings for annotations on invalid types[/+]on Feb 11, 2022
Activity
sbomer commentedon Feb 11, 2022
I realized it doesn't make sense to propagate through
get_TypeHandlebecause we don't support annotations onRuntimeTypeHandle. The current logic is ok because it will propagate the annotation if you doType.GetTypeFromHandle(typeof(T).TypeHandle).The issue we saw in runtime was just that we're producing a warning even though the target is an unsupported type for the annotations - which @tlakollo is working on as part of #2409. I'll leave this issue to track not producing dataflow warnings for unsupportred annotated locations (while the other issue tracks adding warnings for the invalid annotations).
[-][DAM analyzer] Analyzer and linker produce warning for generic parameter TypeHandle[/-][+][DAM analyzer] Don't produce dataflow warnings for annotations on invalid types[/+]tlakollo commentedon Feb 15, 2022
Closed via #2599