Skip to content

Commit 1323b3f

Browse files
author
Dave Bartolomeo
committed
Revert "Merge pull request github#18235 from owen-mc/go/varargs-out-param"
This reverts commit 4f8645b, reversing changes made to 22aaf74.
1 parent 3dcf49c commit 1323b3f

File tree

26 files changed

+9
-350
lines changed

26 files changed

+9
-350
lines changed

go/ql/lib/change-notes/2024-12-06-improve-flow-out-of-variadic-parameter.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

go/ql/lib/semmle/go/dataflow/internal/ContainerFlow.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ predicate containerReadStep(Node node1, Node node2, Content c) {
6666
(
6767
node2.(Read).readsElement(node1, _)
6868
or
69-
exists(ImplicitVarargsSlice ivs |
70-
node1.(PostUpdateNode).getPreUpdateNode() = ivs and
71-
node2.(PostUpdateNode).getPreUpdateNode() = ivs.getCallNode().getAnImplicitVarargsArgument()
72-
)
73-
or
7469
node2.(RangeElementNode).getBase() = node1
7570
or
7671
// To model data flow from array elements of the base of a `SliceNode` to

go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,9 +845,6 @@ module Public {
845845
or
846846
preupd = getAWrittenNode()
847847
or
848-
preupd instanceof ImplicitVarargsSlice and
849-
mutableType(preupd.(ImplicitVarargsSlice).getType().(SliceType).getElementType())
850-
or
851848
preupd = any(ArgumentNode arg).getACorrespondingSyntacticArgument() and
852849
mutableType(preupd.getType())
853850
) and

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/completetest.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import semmle.go.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
99
import utils.test.InlineFlowTest
1010

1111
module Config implements DataFlow::ConfigSig {
12-
predicate isSource(DataFlow::Node source) { sourceNode(source, "qltest") }
12+
predicate isSource(DataFlow::Node src) { sourceNode(src, "qltest") }
1313

14-
predicate isSink(DataFlow::Node sink) { sinkNode(sink, "qltest") }
14+
predicate isSink(DataFlow::Node src) { sinkNode(src, "qltest") }
1515
}
1616

1717
import ValueFlowTest<Config>

go/ql/test/library-tests/semmle/go/dataflow/VarArgs/main.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ func source() string {
44
return "untrusted data"
55
}
66

7-
func sink(any) {
7+
func sink(string) {
88
}
99

1010
type A struct {
@@ -19,10 +19,6 @@ func functionWithVarArgsParameter(s ...string) string {
1919
return s[1]
2020
}
2121

22-
func functionWithVarArgsOutParameter(in string, out ...*string) {
23-
*out[0] = in
24-
}
25-
2622
func functionWithSliceOfStructsParameter(s []A) string {
2723
return s[1].f
2824
}
@@ -42,12 +38,6 @@ func main() {
4238
sink(functionWithVarArgsParameter(sSlice...)) // $ hasValueFlow="call to functionWithVarArgsParameter"
4339
sink(functionWithVarArgsParameter(s0, s1)) // $ hasValueFlow="call to functionWithVarArgsParameter"
4440

45-
var out1 *string
46-
var out2 *string
47-
functionWithVarArgsOutParameter(source(), out1, out2)
48-
sink(out1) // $ MISSING: hasValueFlow="out1"
49-
sink(out2) // $ MISSING: hasValueFlow="out2"
50-
5141
sliceOfStructs := []A{{f: source()}}
5242
sink(sliceOfStructs[0].f) // $ hasValueFlow="selection of f"
5343

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.ext.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/Flows.ql

Lines changed: 0 additions & 22 deletions
This file was deleted.

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/go.mod

Lines changed: 0 additions & 5 deletions
This file was deleted.

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithExternalFlow/main.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)