Skip to content

Commit 20084fb

Browse files
committed
Java: Fix pruning in partialPathStep.
1 parent bf14889 commit 20084fb

File tree

19 files changed

+247
-190
lines changed

19 files changed

+247
-190
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,16 +2218,19 @@ private module FlowExploration {
22182218
private predicate partialPathStep(
22192219
PartialPathNodePriv mid, Node node, CallContext cc, PartialAccessPath ap, Configuration config
22202220
) {
2221-
localFlowStep(mid.getNode(), node, config) and
2222-
cc = mid.getCallContext() and
2223-
ap = mid.getAp() and
2224-
config = mid.getConfiguration()
2225-
or
2226-
additionalLocalFlowStep(mid.getNode(), node, config) and
2227-
cc = mid.getCallContext() and
2228-
mid.getAp() instanceof PartialAccessPathNil and
2229-
ap = TPartialNil(getErasedRepr(node.getType())) and
2230-
config = mid.getConfiguration()
2221+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall()) and
2222+
(
2223+
localFlowStep(mid.getNode(), node, config) and
2224+
cc = mid.getCallContext() and
2225+
ap = mid.getAp() and
2226+
config = mid.getConfiguration()
2227+
or
2228+
additionalLocalFlowStep(mid.getNode(), node, config) and
2229+
cc = mid.getCallContext() and
2230+
mid.getAp() instanceof PartialAccessPathNil and
2231+
ap = TPartialNil(getErasedRepr(node.getType())) and
2232+
config = mid.getConfiguration()
2233+
)
22312234
or
22322235
jumpStep(mid.getNode(), node, config) and
22332236
cc instanceof CallContextAny and

0 commit comments

Comments
 (0)