Skip to content

Commit a7eb87a

Browse files
committed
C++: Fix 'parameterNode' so it is the inverse of Node.asParameter.
1 parent 13a9724 commit a7eb87a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ module Public {
957957
/**
958958
* Gets the `Node` corresponding to the value of `p` at function entry.
959959
*/
960-
ExplicitParameterNode parameterNode(Parameter p) { result.getParameter() = p }
960+
ParameterNode parameterNode(Parameter p) { result.asParameter() = p }
961961

962962
/**
963963
* Gets the `Node` corresponding to a definition by reference of the variable

‎cpp/ql/test/library-tests/dataflow/asExpr/test.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ struct Derived : Foo {};
6464

6565
void test_qualifiers(
6666
Foo x, // $ asParameter=x parameterNode=x
67-
Foo &r, // $ asParameter=r(*r) parameterNode=r
67+
Foo &r, // $ asParameter=r(*r) parameterNode=r(*r)
6868
Foo *p, // $ asParameter=p parameterNode=p
69-
Foo *&rp, // $ asParameter=rp(*rp) parameterNode=rp
69+
Foo *&rp, // $ asParameter=rp(*rp) parameterNode=rp(*rp)
7070
Derived d, // $ asParameter=d parameterNode=d
71-
Derived &rd) { // $ asParameter=rd(*rd) parameterNode=rd
71+
Derived &rd) { // $ asParameter=rd(*rd) parameterNode=rd(*rd)
7272
x.f(); // $ asExpr=x asIndirectExpr=x
7373
r.f(); // $ asExpr=r asIndirectExpr=r
7474
p->f(); // $ asExpr=p asIndirectExpr=p
@@ -81,7 +81,7 @@ void test_qualifiers(
8181

8282
void test_inner_glvalue_qualifiers(
8383
Foo x, // $ asParameter=x parameterNode=x
84-
Foo &r) { // $ asParameter=r(*r) parameterNode=r
84+
Foo &r) { // $ asParameter=r(*r) parameterNode=r(*r)
8585
Foo arr[2];
8686
(*&x).f(); // $ asExpr="* ..." asIndirectExpr="* ..." asExpr="& ...(* ...)" asIndirectExpr="& ...(* ...)" asExpr="x(* ...)" asIndirectExpr="x(* ...)"
8787
(*&r).f(); // $ asExpr="* ..." asIndirectExpr="* ..." asExpr="& ...(* ...)" asIndirectExpr="& ...(* ...)" asExpr="r(* ...)" asIndirectExpr="r(* ...)"

0 commit comments

Comments
 (0)