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

Inline Instructions for Initializing Boolean Instance Field to Default Value #174

Closed matjin closed 2 years ago

matjin commented 2 years ago

This PR implements an inlining of instructions for initializing boolean instance field values to their default values. This is a targeted translation update to eliminate false positive resource leaks that can occur for resources that conditionally dispose depending on the value of an uninitialized boolean field (which in C# means a default initialization to false).

The test case for this is included in https://github.com/microsoft/infersharp/pull/159