Skip to content

Commit 11476b8

Browse files
committed
Address review comments
1 parent 6e5af1a commit 11476b8

28 files changed

Lines changed: 28 additions & 43 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,7 @@ class ReturnPosition extends TReturnPosition0 {
753753
*/
754754
pragma[inline]
755755
DataFlowCallable getNodeEnclosingCallable(Node n) {
756-
exists(Node n0 |
757-
pragma[only_bind_into](n0) = n and
758-
result = n0.getEnclosingCallable()
759-
)
756+
pragma[only_bind_into](result) = n.getEnclosingCallable()
760757
}
761758

762759
pragma[noinline]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private module Stage2 {
765765
bindingset[result, ap]
766766
private ApApprox getApprox(Ap ap) { any() }
767767

768-
private Ap getApNil(Node node) { PrevStage::revFlow(node, _) and result instanceof ApNil }
768+
private ApNil getApNil(Node node) { PrevStage::revFlow(node, _) and exists(result) }
769769

770770
bindingset[tc, tail]
771771
private Ap apCons(TypedContent tc, Ap tail) { result = true and exists(tc) and exists(tail) }

0 commit comments

Comments
 (0)