Skip to content

Commit c9ba6f1

Browse files
committed
Ruby: rename EntryPoint.getAUse,getARhs -> getASource,getASink
1 parent 48761b8 commit c9ba6f1

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

ruby/ql/lib/codeql/ruby/ApiGraphs.qll

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,17 @@ module API {
382382
bindingset[this]
383383
EntryPoint() { any() }
384384

385+
/** DEPRECATED. This predicate has been renamed to `getASource`. */
386+
deprecated DataFlow::LocalSourceNode getAUse() { none() }
387+
388+
/** DEPRECATED. This predicate has been renamed to `getASink`. */
389+
deprecated DataFlow::Node getARhs() { none() }
390+
385391
/** Gets a data-flow node corresponding to a use-node for this entry point. */
386-
DataFlow::LocalSourceNode getAUse() { none() }
392+
DataFlow::LocalSourceNode getASource() { none() }
387393

388394
/** Gets a data-flow node corresponding to a def-node for this entry point. */
389-
DataFlow::Node getARhs() { none() }
395+
DataFlow::Node getASink() { none() }
390396

391397
/** Gets a call corresponding to a method access node for this entry point. */
392398
DataFlow::CallNode getACall() { none() }
@@ -504,7 +510,7 @@ module API {
504510
or
505511
parameterStep(_, defCand(), nd)
506512
or
507-
nd = any(EntryPoint entry).getAUse()
513+
nd = any(EntryPoint entry).getASource()
508514
or
509515
nd = any(EntryPoint entry).getACall()
510516
}
@@ -553,7 +559,7 @@ module API {
553559
// If a call node is relevant as a use-node, treat its arguments as def-nodes
554560
argumentStep(_, useCandFwd(), rhs)
555561
or
556-
rhs = any(EntryPoint entry).getARhs()
562+
rhs = any(EntryPoint entry).getASink()
557563
}
558564

559565
/** Gets a data flow node that flows to the RHS of a def-node. */
@@ -712,9 +718,9 @@ module API {
712718
pred = root() and
713719
lbl = Label::entryPoint(entry)
714720
|
715-
succ = MkDef(entry.getARhs())
721+
succ = MkDef(entry.getASink())
716722
or
717-
succ = MkUse(entry.getAUse())
723+
succ = MkUse(entry.getASource())
718724
or
719725
succ = MkMethodAccessNode(entry.getACall())
720726
)

ruby/ql/test/library-tests/dataflow/api-graphs/use.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CustomEntryPointCall extends API::EntryPoint {
1212
class CustomEntryPointUse extends API::EntryPoint {
1313
CustomEntryPointUse() { this = "CustomEntryPointUse" }
1414

15-
override DataFlow::LocalSourceNode getAUse() {
15+
override DataFlow::LocalSourceNode getASource() {
1616
result.(DataFlow::CallNode).getMethodName() = "customEntryPointUse"
1717
}
1818
}

0 commit comments

Comments
 (0)