Points-to Analysis Across Unreachable Functions from Control Flow Graph #19406
Unanswered
jackfromeast
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi This is a known limitation for, I think, all languages, and it is something that is already on our radar. You are right that this happens because data flow basically considers the I'll add this example to our internal issue tracking this. Thanks |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given the following simple Python code:
I defined the following CodeQL queries:
Taint Flow analysis:
Call Edge Analysis:
PointsTo Analysis:
If I analyze this code alone, all the analyses (taint flow, call edges, points-to) return empty.
However, if I add a simple instantiation and invocation:
Then all the analyses work correctly: the taint flow is detected, call edges are resolved, and points-to results appear.
Questions
Is it because functions not reachable from the control flow graph are simply skipped from points-to/call/taint analysis (the latter two might all depend on the points-to analysis)?
That is, CodeQL cannot analyze them during the points-to analysis if they are "dead code" (unreachable)?
If so, is there a way to fix or improve this?
Many real-world library codes (e.g., APIs, frameworks) don't call their entry points internally. The invocation happens only from external application code. Would this design prevent CodeQL from correctly analyzing libraries?
Could we force CodeQL to conservatively analyze all function bodies even if they are not called?
Beta Was this translation helpful? Give feedback.
All reactions