mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Refactor getLeftmostOperand method
This commit is contained in:
@@ -53,8 +53,13 @@ predicate concatInsecureLdapString(Expr protocol, Expr host) {
|
||||
|
||||
/** Gets the leftmost operand in a concatenated string */
|
||||
Expr getLeftmostConcatOperand(Expr expr) {
|
||||
// if expr instanceof AddExpr
|
||||
// then result = getLeftmostConcatOperand(expr.(AddExpr).getLeftOperand())
|
||||
// else result = expr
|
||||
if expr instanceof AddExpr
|
||||
then result = getLeftmostConcatOperand(expr.(AddExpr).getLeftOperand())
|
||||
then
|
||||
result = expr.(AddExpr).getLeftOperand*() and
|
||||
not result instanceof AddExpr
|
||||
else result = expr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user