mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
C++: Add LambdaExpression.getInitializer()
This commit is contained in:
@@ -57,6 +57,14 @@ class LambdaExpression extends Expr, @lambdaexpr {
|
||||
Operator getLambdaFunction() {
|
||||
result = getType().(Closure).getLambdaFunction()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the initializer that initializes the captured variables in the closure, if any.
|
||||
* A lambda that does not capture any variables will not have an initializer.
|
||||
*/
|
||||
Expr getInitializer() {
|
||||
result = getChild(0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -270,7 +270,7 @@ newtype TTranslatedElement =
|
||||
throw.getExpr().getFullyConverted() = expr
|
||||
) or
|
||||
exists(LambdaExpression lambda |
|
||||
lambda.getChild(0).getFullyConverted() = expr
|
||||
lambda.getInitializer().getFullyConverted() = expr
|
||||
)
|
||||
)
|
||||
} or
|
||||
|
||||
Reference in New Issue
Block a user