question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions about infersharp implementation

See original GitHub issue

Hello!

Thanks for this tool and the PR about language-agnostic layer.

This issue is not going to report some bugs and features. I just wanna get answers to my a few questions, which are mainly about infersharp implementation.

  • Why MethodBody can be found everywhere in cfg.json? And what’s the logic of it? Perhaps I fail to figure out what MethodBody means? (e.g Why LdargParser generates MethodBody node, while LdcParser doesn’t.)
  • Is Metadata instruction useful? I wanna know the reason infersharp doesn’t implement it.
  • The point I mostly concerned is whether infer can run some language-unrelated checkers with data (cfg.json & tenv.json) received from language-agnostic layer interface.

Many thanks!

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matjincommented, Nov 17, 2022

In general, when the CIL corresponds to an SIL instruction, we create the corresponding SIL instruction which in turn gets added to a MethodBody node. Not all CIL have such a correspondence – for example, ldc refers to the pushing of a constant onto the CIL program stack but has no direct corresponding operation in SIL because the constant doesn’t come from a register. By contrast, ldarg refers to the pushing of an argument’s value onto the CIL program stack; this corresponds to the load of the argument register. Similarly, Initobj/Newarr refer to the creation of objects, which correspond to Call instructions in the SIL, hence we create MethodBody nodes to store these instructions.

0reactions
skyleaworldercommented, Nov 17, 2022

In general, when the CIL corresponds to an SIL instruction, we create the corresponding SIL instruction which in turn gets added to a MethodBody node. Not all CIL have such a correspondence – for example, ldc refers to the pushing of a constant onto the CIL program stack but has no direct corresponding operation in SIL because the constant doesn’t come from a register. By contrast, ldarg refers to the pushing of an argument’s value onto the CIL program stack; this corresponds to the load of the argument register. Similarly, Initobj/Newarr refer to the creation of objects, which correspond to Call instructions in the SIL, hence we create MethodBody nodes to store these instructions.

Thanks for your patient answer! Make sense here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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, ...
Read more >
First look at InferSharp: A C# version of Facebook's Infer
Infer belongs to Facebook and it is a static analysis tool to produce a list of potential bugs such as null pointer exceptions,...
Read more >
Slaying Zombie 'No Repro' Crashes with Infer# - .NET Blog
First, make sure that Windows Subsystem for Linux (WSL) is properly installed. Then, download and install the InferSharp extension from the ...
Read more >
Infer# Brings Facebook's Infer Static Analyzer to C# and .NET
With Infer#, Microsoft extends the choice of static analyzers available within the .NET ecosystem by bringing Facebook Infer's ...
Read more >
Newest 'infer#' Questions
I am running a static analyzer (InferSharp) that keeps warning me that this will not properly close the resource as it gives me...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found