Skip to content

Commit ece2f03

Browse files
author
Paolo Tranquilli
committed
Rust: fix QL compilation errors after renames
1 parent 394f3eb commit ece2f03

File tree

18 files changed

+32
-32
lines changed

18 files changed

+32
-32
lines changed

rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ module ExprTrees {
329329
}
330330

331331
class FieldExprTree extends StandardPostOrderTree instanceof FieldExpr {
332-
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
332+
override AstNode getChildNode(int i) { i = 0 and result = super.getContainer() }
333333
}
334334

335335
class IfExprTree extends PostOrderTree instanceof IfExpr {

rust/ql/lib/codeql/rust/dataflow/internal/Content.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ final class TuplePositionContent extends FieldContent, TTuplePositionContent {
150150

151151
override FieldExprCfgNode getAnAccess() {
152152
// TODO: limit to tuple types
153-
result.getNameRef().getText().toInt() = pos
153+
result.getIdentifier().getText().toInt() = pos
154154
}
155155

156156
override string toString() { result = "tuple." + pos.toString() }
@@ -262,7 +262,7 @@ newtype TContent =
262262
TTuplePositionContent(int pos) {
263263
pos in [0 .. max([
264264
any(TuplePat pat).getNumberOfFields(),
265-
any(FieldExpr access).getNameRef().getText().toInt()
265+
any(FieldExpr access).getIdentifier().getText().toInt()
266266
]
267267
)]
268268
} or

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ module RustDataFlow implements InputSig<Location> {
688688
node1.asPat().(RefPatCfgNode).getPat() = node2.asPat()
689689
or
690690
exists(FieldExprCfgNode access |
691-
node1.asExpr() = access.getExpr() and
691+
node1.asExpr() = access.getContainer() and
692692
node2.asExpr() = access and
693693
access = c.(FieldContent).getAnAccess()
694694
)
@@ -771,7 +771,7 @@ module RustDataFlow implements InputSig<Location> {
771771
exists(AssignmentExprCfgNode assignment, FieldExprCfgNode access |
772772
assignment.getLhs() = access and
773773
node1.asExpr() = assignment.getRhs() and
774-
node2.asExpr() = access.getExpr() and
774+
node2.asExpr() = access.getContainer() and
775775
access = c.getAnAccess()
776776
)
777777
}

rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module Input implements InputSig<Location, RustDataFlow> {
4747
private class MethodCallExprNameRef extends SourceBase, SinkBase {
4848
private MethodCallExpr call;
4949

50-
MethodCallExprNameRef() { this = call.getNameRef() }
50+
MethodCallExprNameRef() { this = call.getIdentifier() }
5151

5252
override MethodCallExpr getCall() { result = call }
5353
}

rust/ql/lib/codeql/rust/dataflow/internal/Node.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ newtype TNode =
464464
e =
465465
[
466466
any(IndexExprCfgNode i).getBase(), //
467-
any(FieldExprCfgNode access).getExpr(), //
467+
any(FieldExprCfgNode access).getContainer(), //
468468
any(TryExprCfgNode try).getExpr(), //
469469
any(PrefixExprCfgNode pe | pe.getOperatorName() = "*").getExpr(), //
470470
any(AwaitExprCfgNode a).getExpr(), any(MethodCallExprCfgNode mc).getReceiver(), //

rust/ql/lib/codeql/rust/elements/internal/FieldExprImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ module Impl {
3030

3131
override string toStringImpl() {
3232
exists(string abbr, string name |
33-
abbr = this.getExpr().toAbbreviatedString() and
34-
name = this.getNameRef().getText() and
33+
abbr = this.getContainer().toAbbreviatedString() and
34+
name = this.getIdentifier().getText() and
3535
if abbr = "..." then result = "... ." + name else result = abbr + "." + name
3636
)
3737
}

rust/ql/lib/codeql/rust/elements/internal/MethodCallExprImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module Impl {
4646
exists(string base, string separator |
4747
base = this.getReceiver().toAbbreviatedString() and
4848
(if base = "..." then separator = " ." else separator = ".") and
49-
result = base + separator + this.getNameRef().toStringImpl() + "(...)"
49+
result = base + separator + this.getIdentifier().toStringImpl() + "(...)"
5050
)
5151
}
5252
}

rust/ql/lib/codeql/rust/elements/internal/PathImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module Impl {
3939
* Gets the text of this path, if it exists.
4040
*/
4141
pragma[nomagic]
42-
string getText() { result = this.getSegment().getNameRef().getText() }
42+
string getText() { result = this.getSegment().getIdentifier().getText() }
4343
}
4444

4545
/** A simple identifier path. */
@@ -54,7 +54,7 @@ module Impl {
5454
not ps.hasParenthesizedArgList() and
5555
not ps.hasTypeRepr() and
5656
not ps.hasReturnTypeSyntax() and
57-
name = ps.getNameRef().getText()
57+
name = ps.getIdentifier().getText()
5858
)
5959
}
6060

rust/ql/lib/codeql/rust/elements/internal/PathSegmentImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Impl {
2424

2525
private string toAbbreviatedStringPart(int index) {
2626
index = 0 and
27-
if this.hasTypeRepr() then result = "<...>" else result = this.getNameRef().getText()
27+
if this.hasTypeRepr() then result = "<...>" else result = this.getIdentifier().getText()
2828
or
2929
index = 1 and result = this.getGenericArgList().toAbbreviatedString()
3030
}

rust/ql/lib/codeql/rust/elements/internal/StructExprFieldImpl.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ module Impl {
2525
override string toStringImpl() { result = concat(int i | | this.toStringPart(i) order by i) }
2626

2727
private string toStringPart(int index) {
28-
index = 0 and result = this.getNameRef().getText()
28+
index = 0 and result = this.getIdentifier().getText()
2929
or
30-
index = 1 and this.hasNameRef() and result = ": "
30+
index = 1 and this.hasIdentifier() and result = ": "
3131
or
3232
index = 2 and
3333
result = this.getExpr().toAbbreviatedString()
@@ -44,9 +44,9 @@ module Impl {
4444
* ```
4545
*/
4646
string getFieldName() {
47-
result = this.getNameRef().getText()
47+
result = this.getIdentifier().getText()
4848
or
49-
not this.hasNameRef() and
49+
not this.hasIdentifier() and
5050
result = this.getExpr().(PathExpr).getPath().(PathImpl::IdentPath).getName()
5151
}
5252
}

0 commit comments

Comments
 (0)