|
I was trying to understand GuardedCondition
predicate controls(BasicBlock controlled, boolean testIsTrue)
predicate valueControls(BasicBlock controlled, AbstractValue v)The controls predicate :
The valueControls predicate :
And finally AbstractValue
But wait ... wasn't it explicitly stated in GuardedCondition that it doesn't take switch case statement into account ? So what's the point of valueControls ? My guess is that I have a wrong understanding of what is an AbstractValue is because I don't see their point in others predicates (such as comparesEq. Nor do I understand what does "dertermined by this guard" means in the documentation despite reading this I supposed it means "in the direct basic block after evaluation" but I also don't understand the point of k in |
Replies: 1 comment 1 reply
It looks like the QLDoc for hasn't been updated since we added support for switch statements (for what it's worth, this was done in #15941). I've opened a PR to fix the documentation here. That should hopefully take care of the first part of your question :) Now let's take the next part:
"determined by this guard" means "implied by this guard". That is, if you have a guard such as: if(a == b + 42 && c > 0) { ... }then both Finally:
You don't need three variables for the comparison, but you can use it if it's useful to you. The point is that, there are many ways of writing a comparison such as If you don't care about from GuardCondition gc, Expr left, Expr right, boolean b
where gc.comparesEq(left, right, 0, true, b)
select gc, left, right, bfinds values |
It looks like the QLDoc for hasn't been updated since we added support for switch statements (for what it's worth, this was done in #15941). I've opened a PR to fix the documentation here.
That should hopefully take care of the first part of your question :)
Now let's take the next part:
"determined by this guard" means "implied by this guard". That is, if …