Closed matjin closed 1 year ago
Latest Infer has skip-translation
deprecated. I think we should update this line by replacing skip-translation
as capture-block-list
and removing language
.
Please take a look at this example.
Latest Infer has
skip-translation
deprecated. I think we should update this line by replacingskip-translation
ascapture-block-list
and removinglanguage
.Please take a look at this example.
I removed the skip-translation. capture-block-list references Java/Clang specifically so not sure about compatibility with .NET. It looks nonessential anyway, so will delete for now.
Async methods cause the compiler to spin up state machine classes around these methods; with new fields and methods. Particularly notably:
All of these technicalities are addressed in this PR, along with a QoL fix to a frequently encountered issue to do with wrong line numbers being reported, particularly for resource leaks. The changes are:
1/3 : We mock the initializer behavior: we inline Store instructions within the MoveNext() method which initialize the fields storing the parameters to the parameter values and initializes the state field to -1, so that Infer can correctly understand that the fields store the parameter values and that the state field is negative.
These changes generally enable Infer to treat the asynchronous methods almost identically to synchronous methods.
Additionally, the start node of a method is now mapped to the first real line of code, and the end node of a method is now mapped to the last real line of code. This should fix most of the issues we had encountered with line numbers.
Tested:
Added to the Examples.cs file some taint examples, focused on async methods, to validate the above changes. A false positive that had existed in the past with an async method returning an iDisposable method is now no longer reported, as desired.