Merge pull request #7588 from owen-mc/add-specific-needs-reference-predicates

Dataflow: Add language-specific NeedsReference predicates
This commit is contained in:
Owen Mansel-Chan
2022-01-17 15:51:34 +00:00
committed by GitHub
6 changed files with 30 additions and 6 deletions

View File

@@ -921,13 +921,15 @@ module Private {
private predicate inputNeedsReference(string c) {
c = "Argument" or
parseArg(c, _)
parseArg(c, _) or
inputNeedsReferenceSpecific(c)
}
private predicate outputNeedsReference(string c) {
c = "Argument" or
parseArg(c, _) or
c = "ReturnValue"
c = "ReturnValue" or
outputNeedsReferenceSpecific(c)
}
private predicate sourceElementRef(InterpretNode ref, string output, string kind) {

View File

@@ -102,6 +102,12 @@ string getParameterPositionCsv(ParameterPosition pos) { result = pos.toString()
/** Gets the textual representation of an argument position in the format used for flow summaries. */
string getArgumentPositionCsv(ArgumentPosition pos) { result = pos.toString() }
/** Holds if input specification component `c` needs a reference. */
predicate inputNeedsReferenceSpecific(string c) { none() }
/** Holds if output specification component `c` needs a reference. */
predicate outputNeedsReferenceSpecific(string c) { none() }
class SourceOrSinkElement = Top;
/**