Ruby: Block flow from LHS of && expressions

The only values that can flow from the LHS of an && expression are
`false` and `nil`, neither of which seem relevant for any of our
queries.
This commit is contained in:
Harry Maclean
2024-01-30 08:53:32 +00:00
parent aeae208dc3
commit 75b13da4e4

View File

@@ -220,8 +220,10 @@ module LocalFlow {
or
nodeTo.asExpr() =
any(CfgNodes::ExprNodes::BinaryOperationCfgNode op |
op.getExpr() instanceof BinaryLogicalOperation and
op.getExpr() instanceof LogicalOrExpr and
nodeFrom.asExpr() = op.getAnOperand()
or
op.getExpr() instanceof LogicalAndExpr and nodeFrom.asExpr() = op.getRightOperand()
)
or
nodeTo.(ParameterNodeImpl).getParameter() =