File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1652,8 +1652,18 @@ private string getConstantString(Expr e) {
16521652 * Holds if `add` is a string-concatenation where all the transitive leafs have a constant string value.
16531653 */
16541654private predicate hasAllConstantLeafs ( AddExpr add ) {
1655- forex ( Expr leaf | leaf = getAnAddOperand * ( add ) and not exists ( getAnAddOperand ( leaf ) ) |
1656- exists ( getConstantString ( leaf ) )
1655+ exists ( getConstantString ( add .getLeftOperand ( ) ) ) and
1656+ exists ( getConstantString ( add .getRightOperand ( ) ) )
1657+ or
1658+ (
1659+ hasAllConstantLeafs ( add .getLeftOperand ( ) .getUnderlyingValue ( ) ) and
1660+ hasAllConstantLeafs ( add .getRightOperand ( ) .getUnderlyingValue ( ) )
1661+ or
1662+ hasAllConstantLeafs ( add .getLeftOperand ( ) ) and
1663+ exists ( getConstantString ( add .getRightOperand ( ) ) )
1664+ or
1665+ hasAllConstantLeafs ( add .getRightOperand ( ) ) and
1666+ exists ( getConstantString ( add .getLeftOperand ( ) ) )
16571667 )
16581668}
16591669
You can’t perform that action at this time.
0 commit comments