microsoft / infersharp

Infer# is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null dereferences, resource leaks, and thread-safety violations. It also performs taint flow tracking to detect critical security vulnerabilities like SQL injections.
MIT License
732 stars 29 forks source link

Wrong Line Number On Reported Issues #75

Open matjin opened 2 years ago

matjin commented 2 years ago

We sometimes observe the wrong line number being recorded on reported issues, particularly when there are some compiler-generated class methods. This occurs as a result of the wrong line number being read from the PDB file by Mono.Cecil (for example, async methods cause the compiler to auto-generate a lot of code, which is not associated with any line number https://github.com/jbevain/cecil/issues/805) and therefore is an issue upstream of InferSharp.

To mitigate the issue we will include method names in resource leak warnings. Additionally, in the case of resource leak the warning is localized to one of the instances of the reported type.