Skip to content

Commit 75ebc09

Browse files
committed
Java: Fix semantic merge conflict.
1 parent b581e38 commit 75ebc09

File tree

5 files changed

+69
-45
lines changed

5 files changed

+69
-45
lines changed

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,16 @@ private module ImplCommon {
468468
int i, ArgumentNode arg, CallContext outercc, DataFlowCall call
469469
) {
470470
exists(DataFlowCallable c | argumentOf(call, i, arg, c) |
471-
outercc = TAnyCallContext()
472-
or
473-
outercc = TSomeCall(getAParameter(c), _)
474-
or
475-
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
476-
reducedViableImplInCallContext(_, c, other)
477-
)
471+
(
472+
outercc = TAnyCallContext()
473+
or
474+
outercc = TSomeCall(getAParameter(c), _)
475+
or
476+
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
477+
recordDataFlowCallSite(other, c)
478+
)
479+
) and
480+
not isUnreachableInCall(arg, outercc.(CallContextSpecificCall).getCall())
478481
)
479482
}
480483

@@ -500,7 +503,7 @@ private module ImplCommon {
500503
exists(int i, DataFlowCallable callable |
501504
viableParamArg1(p, callable, i, arg, outercc, call)
502505
|
503-
if reducedViableImplInCallContext(_, callable, call)
506+
if recordDataFlowCallSite(call, callable)
504507
then innercc = TSpecificCall(call, i, true)
505508
else innercc = TSomeCall(p, true)
506509
)
@@ -512,7 +515,7 @@ private module ImplCommon {
512515
exists(DataFlowCall call, int i, DataFlowCallable callable |
513516
result = TSpecificCall(call, i, _) and
514517
p.isParameterOf(callable, i) and
515-
reducedViableImplInCallContext(_, callable, call)
518+
recordDataFlowCallSite(call, callable)
516519
)
517520
}
518521

@@ -528,14 +531,16 @@ private module ImplCommon {
528531
exists(Node mid |
529532
parameterValueFlow(p, mid, cc) and
530533
step(mid, node) and
531-
compatibleTypes(p.getType(), node.getType())
534+
compatibleTypes(p.getType(), node.getType()) and
535+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
532536
)
533537
or
534538
// flow through a callable
535539
exists(Node arg |
536540
parameterValueFlow(p, arg, cc) and
537541
argumentValueFlowsThrough(arg, node, cc) and
538-
compatibleTypes(p.getType(), node.getType())
542+
compatibleTypes(p.getType(), node.getType()) and
543+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
539544
)
540545
}
541546

@@ -568,6 +573,7 @@ private module ImplCommon {
568573
argumentValueFlowsThrough0(call, arg, kind, cc)
569574
|
570575
out = getAnOutNode(call, kind) and
576+
not isUnreachableInCall(out, cc.(CallContextSpecificCall).getCall()) and
571577
compatibleTypes(arg.getType(), out.getType())
572578
)
573579
}

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,16 @@ private module ImplCommon {
468468
int i, ArgumentNode arg, CallContext outercc, DataFlowCall call
469469
) {
470470
exists(DataFlowCallable c | argumentOf(call, i, arg, c) |
471-
outercc = TAnyCallContext()
472-
or
473-
outercc = TSomeCall(getAParameter(c), _)
474-
or
475-
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
476-
reducedViableImplInCallContext(_, c, other)
477-
)
471+
(
472+
outercc = TAnyCallContext()
473+
or
474+
outercc = TSomeCall(getAParameter(c), _)
475+
or
476+
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
477+
recordDataFlowCallSite(other, c)
478+
)
479+
) and
480+
not isUnreachableInCall(arg, outercc.(CallContextSpecificCall).getCall())
478481
)
479482
}
480483

@@ -500,7 +503,7 @@ private module ImplCommon {
500503
exists(int i, DataFlowCallable callable |
501504
viableParamArg1(p, callable, i, arg, outercc, call)
502505
|
503-
if reducedViableImplInCallContext(_, callable, call)
506+
if recordDataFlowCallSite(call, callable)
504507
then innercc = TSpecificCall(call, i, true)
505508
else innercc = TSomeCall(p, true)
506509
)
@@ -512,7 +515,7 @@ private module ImplCommon {
512515
exists(DataFlowCall call, int i, DataFlowCallable callable |
513516
result = TSpecificCall(call, i, _) and
514517
p.isParameterOf(callable, i) and
515-
reducedViableImplInCallContext(_, callable, call)
518+
recordDataFlowCallSite(call, callable)
516519
)
517520
}
518521

@@ -528,14 +531,16 @@ private module ImplCommon {
528531
exists(Node mid |
529532
parameterValueFlow(p, mid, cc) and
530533
step(mid, node) and
531-
compatibleTypes(p.getType(), node.getType())
534+
compatibleTypes(p.getType(), node.getType()) and
535+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
532536
)
533537
or
534538
// flow through a callable
535539
exists(Node arg |
536540
parameterValueFlow(p, arg, cc) and
537541
argumentValueFlowsThrough(arg, node, cc) and
538-
compatibleTypes(p.getType(), node.getType())
542+
compatibleTypes(p.getType(), node.getType()) and
543+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
539544
)
540545
}
541546

@@ -568,6 +573,7 @@ private module ImplCommon {
568573
argumentValueFlowsThrough0(call, arg, kind, cc)
569574
|
570575
out = getAnOutNode(call, kind) and
576+
not isUnreachableInCall(out, cc.(CallContextSpecificCall).getCall()) and
571577
compatibleTypes(arg.getType(), out.getType())
572578
)
573579
}

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,16 @@ private module ImplCommon {
468468
int i, ArgumentNode arg, CallContext outercc, DataFlowCall call
469469
) {
470470
exists(DataFlowCallable c | argumentOf(call, i, arg, c) |
471-
outercc = TAnyCallContext()
472-
or
473-
outercc = TSomeCall(getAParameter(c), _)
474-
or
475-
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
476-
reducedViableImplInCallContext(_, c, other)
477-
)
471+
(
472+
outercc = TAnyCallContext()
473+
or
474+
outercc = TSomeCall(getAParameter(c), _)
475+
or
476+
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
477+
recordDataFlowCallSite(other, c)
478+
)
479+
) and
480+
not isUnreachableInCall(arg, outercc.(CallContextSpecificCall).getCall())
478481
)
479482
}
480483

@@ -500,7 +503,7 @@ private module ImplCommon {
500503
exists(int i, DataFlowCallable callable |
501504
viableParamArg1(p, callable, i, arg, outercc, call)
502505
|
503-
if reducedViableImplInCallContext(_, callable, call)
506+
if recordDataFlowCallSite(call, callable)
504507
then innercc = TSpecificCall(call, i, true)
505508
else innercc = TSomeCall(p, true)
506509
)
@@ -512,7 +515,7 @@ private module ImplCommon {
512515
exists(DataFlowCall call, int i, DataFlowCallable callable |
513516
result = TSpecificCall(call, i, _) and
514517
p.isParameterOf(callable, i) and
515-
reducedViableImplInCallContext(_, callable, call)
518+
recordDataFlowCallSite(call, callable)
516519
)
517520
}
518521

@@ -528,14 +531,16 @@ private module ImplCommon {
528531
exists(Node mid |
529532
parameterValueFlow(p, mid, cc) and
530533
step(mid, node) and
531-
compatibleTypes(p.getType(), node.getType())
534+
compatibleTypes(p.getType(), node.getType()) and
535+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
532536
)
533537
or
534538
// flow through a callable
535539
exists(Node arg |
536540
parameterValueFlow(p, arg, cc) and
537541
argumentValueFlowsThrough(arg, node, cc) and
538-
compatibleTypes(p.getType(), node.getType())
542+
compatibleTypes(p.getType(), node.getType()) and
543+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
539544
)
540545
}
541546

@@ -568,6 +573,7 @@ private module ImplCommon {
568573
argumentValueFlowsThrough0(call, arg, kind, cc)
569574
|
570575
out = getAnOutNode(call, kind) and
576+
not isUnreachableInCall(out, cc.(CallContextSpecificCall).getCall()) and
571577
compatibleTypes(arg.getType(), out.getType())
572578
)
573579
}

java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,16 @@ private module ImplCommon {
468468
int i, ArgumentNode arg, CallContext outercc, DataFlowCall call
469469
) {
470470
exists(DataFlowCallable c | argumentOf(call, i, arg, c) |
471-
outercc = TAnyCallContext()
472-
or
473-
outercc = TSomeCall(getAParameter(c), _)
474-
or
475-
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
476-
reducedViableImplInCallContext(_, c, other)
477-
)
471+
(
472+
outercc = TAnyCallContext()
473+
or
474+
outercc = TSomeCall(getAParameter(c), _)
475+
or
476+
exists(DataFlowCall other | outercc = TSpecificCall(other, _, _) |
477+
recordDataFlowCallSite(other, c)
478+
)
479+
) and
480+
not isUnreachableInCall(arg, outercc.(CallContextSpecificCall).getCall())
478481
)
479482
}
480483

@@ -500,7 +503,7 @@ private module ImplCommon {
500503
exists(int i, DataFlowCallable callable |
501504
viableParamArg1(p, callable, i, arg, outercc, call)
502505
|
503-
if reducedViableImplInCallContext(_, callable, call)
506+
if recordDataFlowCallSite(call, callable)
504507
then innercc = TSpecificCall(call, i, true)
505508
else innercc = TSomeCall(p, true)
506509
)
@@ -512,7 +515,7 @@ private module ImplCommon {
512515
exists(DataFlowCall call, int i, DataFlowCallable callable |
513516
result = TSpecificCall(call, i, _) and
514517
p.isParameterOf(callable, i) and
515-
reducedViableImplInCallContext(_, callable, call)
518+
recordDataFlowCallSite(call, callable)
516519
)
517520
}
518521

@@ -528,14 +531,16 @@ private module ImplCommon {
528531
exists(Node mid |
529532
parameterValueFlow(p, mid, cc) and
530533
step(mid, node) and
531-
compatibleTypes(p.getType(), node.getType())
534+
compatibleTypes(p.getType(), node.getType()) and
535+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
532536
)
533537
or
534538
// flow through a callable
535539
exists(Node arg |
536540
parameterValueFlow(p, arg, cc) and
537541
argumentValueFlowsThrough(arg, node, cc) and
538-
compatibleTypes(p.getType(), node.getType())
542+
compatibleTypes(p.getType(), node.getType()) and
543+
not isUnreachableInCall(node, cc.(CallContextSpecificCall).getCall())
539544
)
540545
}
541546

@@ -568,6 +573,7 @@ private module ImplCommon {
568573
argumentValueFlowsThrough0(call, arg, kind, cc)
569574
|
570575
out = getAnOutNode(call, kind) and
576+
not isUnreachableInCall(out, cc.(CallContextSpecificCall).getCall()) and
571577
compatibleTypes(arg.getType(), out.getType())
572578
)
573579
}

java/ql/src/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
private import java
22
private import DataFlowUtil
3-
private import DataFlowImplCommon
3+
private import DataFlowImplCommon::Public
44
private import DataFlowDispatch
55
private import semmle.code.java.controlflow.Guards
66
private import semmle.code.java.dataflow.SSA

0 commit comments

Comments
 (0)