Refactor getLeftmostOperand method

This commit is contained in:
Ed Minnix
2023-03-03 15:01:13 -05:00
parent 5ff4fcbc76
commit 938d953789

View File

@@ -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
}