Skip to content

Commit c923b9b

Browse files
committed
Ruby: Replace Receiver with Argument[self]
1 parent ec30a0f commit c923b9b

File tree

5 files changed

+225
-228
lines changed

5 files changed

+225
-228
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ predicate summaryElement(DataFlowCallable c, string input, string output, string
5959
*/
6060
bindingset[c]
6161
SummaryComponent interpretComponentSpecific(AccessPathToken c) {
62-
c = "Receiver" and // TODO: replace with Argument[self]
63-
result = FlowSummary::SummaryComponent::receiver()
64-
or
6562
c = "Argument[_]" and
6663
result = FlowSummary::SummaryComponent::argument(any(ParameterPosition pos | pos.isPositional(_)))
6764
or

ruby/ql/lib/codeql/ruby/frameworks/ActiveStorage.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private class Summaries extends ModelInput::SummaryModelCsv {
2424
row =
2525
[
2626
"activestorage;;Member[ActiveStorage].Member[Filename].Method[new];Argument[0];ReturnValue;taint",
27-
"activestorage;;Member[ActiveStorage].Member[Filename].Instance.Method[sanitized];Receiver;ReturnValue;taint",
27+
"activestorage;;Member[ActiveStorage].Member[Filename].Instance.Method[sanitized];Argument[self];ReturnValue;taint",
2828
]
2929
}
3030
}

ruby/ql/lib/codeql/ruby/frameworks/Core.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ private class SplatSummary extends SummarizedCallable {
6161
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
6262
(
6363
// *1 = [1]
64-
input = "Receiver" and
64+
input = "Argument[self]" and
6565
output = "ReturnValue.ArrayElement[0]"
6666
or
6767
// *[1] = [1]
68-
input = "Receiver" and
68+
input = "Argument[self]" and
6969
output = "ReturnValue"
7070
) and
7171
preservesValue = true

0 commit comments

Comments
 (0)