Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Provide a "summary" DFG granularity #2071

Open
oxisto opened this issue Feb 25, 2025 · 0 comments
Open

Provide a "summary" DFG granularity #2071

oxisto opened this issue Feb 25, 2025 · 0 comments

Comments

@oxisto
Copy link
Member

oxisto commented Feb 25, 2025

We have use-cases where we introduce new DFG edges that replace existing DFG edges. For example when we try to resolve dynamic invocations from shared libraries (using the DynamicLoader concept) or if we try to connect values from another component (e.g., a configuration) to the place where its loaded.

These new DFG edges essentially "replace" the existing path, but it's cumbersome to actually delete the existing path (and they are still there - sort of).

For example, when we analyse C code like this:

b = dlsym(lib, "myfunc");

The CXXDynamicLoadingPass will introduce a DFG edge (context sensitive, out) from the original myfunc (if we can resolve it in another component) to the call expression of dlsym. But we will still have a DFG edge from the (probably inferred) function declaration of dlsym to the call expression as well. Both are correct in theory, since we do not know the inner workings of dlsym at this moment, but we have a "summary" DFG edge that tells us that it will load the "myfunc" declaration.

The introduces property of #1994 will not help us in this case, since while we are using concepts to resolve this challenge, the DFG edges we draw are between regular nodes.

Instead we would need to have the information that this is a "summary" DFG edge and maybe the possibility to prefer summary edges when following data flows, since we do not want to deal with multiple incoming DFG edges in some scenarios, e.g., in the ValueEvaluator.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant