mirror of
https://github.com/github/codeql.git
synced 2026-01-30 14:52:57 +01:00
Add isVariadic() on FuncDecl and Function
This commit is contained in:
@@ -137,6 +137,8 @@ class FuncDef extends @funcdef, StmtParent, ExprParent {
|
||||
*/
|
||||
DataFlow::CallNode getACall() { result.getACallee() = this }
|
||||
|
||||
predicate isVariadic() { getType().isVariadic() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "FuncDef" }
|
||||
}
|
||||
|
||||
|
||||
@@ -377,6 +377,12 @@ class Function extends ValueEntity, @functionobject {
|
||||
/** Gets the declaration of this function, if any. */
|
||||
FuncDecl getFuncDecl() { none() }
|
||||
|
||||
predicate isVariadic() {
|
||||
this.(BuiltinFunction).getName() = ["append", "make", "print", "println"]
|
||||
or
|
||||
this.(DeclaredFunction).getFuncDecl().isVariadic()
|
||||
}
|
||||
|
||||
/** Holds if this function has no observable side effects. */
|
||||
predicate mayHaveSideEffects() { none() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user