codeql
codeql copied to clipboard
QL: add restrictive transitive closure query
trafficstars
Identifies the mistake fixed in this PR: https://github.com/github/codeql/pull/8380
Basically, a transitive closure might restrict the type when you do zero steps through it, which might not be intentional.
I think the results found by the query are benign (except for the one already fixed, and the one in the experimental query).
Out of interest, is there a "canonical" fix for the case where you don't want the type to be restricted?
The fix I went for was to replace: stepPred*(x) with [x, stepPred+(x)].
That fix should work in all cases.