Skip to content

How to perform strict constant detection #6602

Answered by smowton
fan-14 asked this question in Q&A
Discussion options

You must be logged in to vote

The flow step node1.asExpr().getParent()=node2.asExpr() is likely too vague to do anything useful: for example, if a PredictableSeedExpr flowed to x in f(x, y) then because f(x, y) is a parent we would note flow to the result of f, even if the function doesn't actually return x or anything related to it. It would even create flow from x in x == 100 ? y : z to the whole conditional expression, even though x definitely did not flow there.

It sounds like you want to know what expressions are always constant? In that case the data-flow library is probably not what you want: it determines when data may flow to a particular expression, whereas you want to determine when some property (constant-…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fan-14
Comment options

Answer selected by adityasharad
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