ignore when the reciever is the empty array

This commit is contained in:
Erik Krogh Kristensen
2019-10-27 00:24:38 +02:00
parent da23898eba
commit c6f53199d4

View File

@@ -41,5 +41,7 @@ predicate isIgnoredPureArrayCall(DataFlow::MethodCallNode call) {
}
from DataFlow::MethodCallNode call
where callsArray(call) instanceof DataFlow::ArrayCreationNode
where
callsArray(call) instanceof DataFlow::ArrayCreationNode and
not call.getReceiver().asExpr().(ArrayExpr).getSize() = 0
select call, "Result from call to " + call.getMethodName() + " ignored."