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
727 stars 29 forks source link

Add System.Diagnostics.Debug to Preloaded Tenv #148

Closed matjin closed 2 years ago

matjin commented 2 years ago

This PR adds System.Diagnostics.Debug to the preloaded type environment. This is necessary to enable modeling for System.Diagnostics.Debug.Assert(...) to work, which will prevent Infer from reporting on the following sequence:

var x = null; Debug.Assert(x != null); x.GetHashCode();