Skip to content

Interprocedural Range Analysis #17425

Answered by mbg
elManto asked this question in Q&A
Sep 10, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @elManto 👋🏻

Thanks for the question!

Indeed, SimpleRangeAnalysis only supports intra-procedural range analysis. I am afraid that we also don't have anything off-the-shelf for inter-procedural range analysis. This is partially because, e.g. in your code, it can be difficult to tell whether bar and bar2 are only ever called from foo.

If you are willing to do so, it is possible to extend SimpleRangeAnalysis with custom bounds for things by extending the SimpleRangeAnalysisExpr class. For example, see CustomAddFunctionCall in this directory. You could use this approach to model bounds for particular functions, or even to link up the ranges for arguments to a call with the parameters of a f…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@elManto
Comment options

@mbg
Comment options

Answer selected by elManto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants