Adding exclusion for main's argv (I believe this and other changes were accidentally removed in prior merge with other non-const branches)

This commit is contained in:
Benjamin Rodes
2024-02-16 11:18:06 -05:00
parent 9f3dd6300f
commit 0410ed734b

View File

@@ -69,7 +69,10 @@ predicate isNonConst(DataFlow::Node node) {
// Parameters of uncalled functions that aren't const
exists(UncalledFunction f, Parameter p |
f.getAParameter() = p and
p = node.asParameter()
p = node.asParameter() and
// Ignore main's argv parameter as it is already considered a `FlowSource`
// not ignoring it will result in path redundancies
(f.getName() = "main" implies p.getName() != "argv")
)
or
// Consider as an input any out arg of a function or a function's return where the function is not: