From e123f97303b44c8a30be1e51bc6b24e2a81cf42d Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Wed, 9 Oct 2019 09:35:30 +0200 Subject: [PATCH] Java: Remove useless pruning. --- .../cpp/dataflow/internal/DataFlowImpl.qll | 66 +++++++++---------- .../cpp/dataflow/internal/DataFlowImpl2.qll | 66 +++++++++---------- .../cpp/dataflow/internal/DataFlowImpl3.qll | 66 +++++++++---------- .../cpp/dataflow/internal/DataFlowImpl4.qll | 66 +++++++++---------- .../dataflow/internal/DataFlowImplLocal.qll | 66 +++++++++---------- .../cpp/ir/dataflow/internal/DataFlowImpl.qll | 66 +++++++++---------- .../ir/dataflow/internal/DataFlowImpl2.qll | 66 +++++++++---------- .../ir/dataflow/internal/DataFlowImpl3.qll | 66 +++++++++---------- .../ir/dataflow/internal/DataFlowImpl4.qll | 66 +++++++++---------- .../csharp/dataflow/internal/DataFlowImpl.qll | 66 +++++++++---------- .../dataflow/internal/DataFlowImpl2.qll | 66 +++++++++---------- .../dataflow/internal/DataFlowImpl3.qll | 66 +++++++++---------- .../dataflow/internal/DataFlowImpl4.qll | 66 +++++++++---------- .../dataflow/internal/DataFlowImpl5.qll | 66 +++++++++---------- .../java/dataflow/internal/DataFlowImpl.qll | 66 +++++++++---------- .../java/dataflow/internal/DataFlowImpl2.qll | 66 +++++++++---------- .../java/dataflow/internal/DataFlowImpl3.qll | 66 +++++++++---------- .../java/dataflow/internal/DataFlowImpl4.qll | 66 +++++++++---------- .../java/dataflow/internal/DataFlowImpl5.qll | 66 +++++++++---------- 19 files changed, 570 insertions(+), 684 deletions(-) diff --git a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll +++ b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll +++ b/cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll index 2f2b84ddca4..e52995407a7 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll index 2f2b84ddca4..e52995407a7 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll index 2f2b84ddca4..e52995407a7 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll index 2f2b84ddca4..e52995407a7 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll index 2f2b84ddca4..e52995407a7 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll index 2f2b84ddca4..e52995407a7 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll index 2f2b84ddca4..e52995407a7 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll index 2f2b84ddca4..e52995407a7 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl2.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl3.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl3.qll index 2f2b84ddca4..e52995407a7 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl3.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl3.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl4.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl4.qll index 2f2b84ddca4..e52995407a7 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl4.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl4.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i] diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl5.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl5.qll index 2f2b84ddca4..e52995407a7 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl5.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl5.qll @@ -1758,22 +1758,19 @@ private predicate pathStep(PathNodeMid mid, Node node, CallContext cc, AccessPat mid.getAp() instanceof AccessPathNil and ap = node.(AccessPathNilNode).getAp() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - contentReadStep(mid, node, ap) and cc = mid.getCallContext() - or - exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) - or - pathOutOfArgument(mid, node, cc) and ap = mid.getAp() - or - pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() - or - pathOutOfCallable(mid, node, cc) and ap = mid.getAp() - or - pathThroughCallable(mid, node, cc, ap) - or - valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() - ) + contentReadStep(mid, node, ap) and cc = mid.getCallContext() + or + exists(Content f, AccessPath ap0 | contentStoreStep(mid, node, ap0, f, cc) and push(ap0, f, ap)) + or + pathOutOfArgument(mid, node, cc) and ap = mid.getAp() + or + pathIntoCallable(mid, node, _, cc, _) and ap = mid.getAp() + or + pathOutOfCallable(mid, node, cc) and ap = mid.getAp() + or + pathThroughCallable(mid, node, cc, ap) + or + valuePathThroughCallable(mid, node, cc) and ap = mid.getAp() } pragma[noinline] @@ -2244,27 +2241,24 @@ private module FlowExploration { ap = TPartialNil(getErasedRepr(node.getType())) and config = mid.getConfiguration() or - not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and - ( - partialPathStoreStep(mid, _, _, node, ap) and - cc = mid.getCallContext() and - config = mid.getConfiguration() - or - exists(PartialAccessPath ap0, Content f | - partialPathReadStep(mid, ap0, f, node, cc, config) and - apConsFwd(ap, f, ap0, config) - ) - or - partialPathOutOfArgument(mid, node, cc, ap, config) - or - partialPathIntoCallable(mid, node, _, cc, _, ap, config) - or - partialPathOutOfCallable(mid, node, cc, ap, config) - or - partialPathThroughCallable(mid, node, cc, ap, config) - or - valuePartialPathThroughCallable(mid, node, cc, ap, config) + partialPathStoreStep(mid, _, _, node, ap) and + cc = mid.getCallContext() and + config = mid.getConfiguration() + or + exists(PartialAccessPath ap0, Content f | + partialPathReadStep(mid, ap0, f, node, cc, config) and + apConsFwd(ap, f, ap0, config) ) + or + partialPathOutOfArgument(mid, node, cc, ap, config) + or + partialPathIntoCallable(mid, node, _, cc, _, ap, config) + or + partialPathOutOfCallable(mid, node, cc, ap, config) + or + partialPathThroughCallable(mid, node, cc, ap, config) + or + valuePartialPathThroughCallable(mid, node, cc, ap, config) } bindingset[result, i]