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 28 forks source link

Add ldftn translation/translation of delegates #204

Closed matjin closed 1 year ago

matjin commented 1 year ago

Adds translation of the ldftn: pushes a function pointer onto the stack. Specifically in the case where that function pointer gets used as a delegate and gets invoked, we represent it as itself rather than via the Delegate.Invoke() method, in line with how such constructs get represented in the clang frontend.

Tested: Added unit test to validate the functionality.