From 127f232c3db02918bbd9140692cf5b0a91cc084f Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Tue, 14 Apr 2020 10:18:48 +0100 Subject: [PATCH] Fix frontend errors in `FlowSteps` test. --- .../semmle/go/dataflow/FlowSteps/LocalFlowStep.expected | 2 ++ ql/test/library-tests/semmle/go/dataflow/FlowSteps/main.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected b/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected index 80acf80639f..f571c354c1c 100644 --- a/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected +++ b/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.expected @@ -83,6 +83,8 @@ | main.go:38:7:38:20 | composite literal | main.go:38:2:38:2 | definition of s | | main.go:39:2:39:3 | definition of s1 | main.go:40:18:40:19 | s1 | | main.go:39:8:39:25 | call to append | main.go:39:2:39:3 | definition of s1 | +| main.go:40:2:40:3 | definition of s2 | main.go:43:9:43:10 | s2 | +| main.go:40:8:40:23 | call to append | main.go:40:2:40:3 | definition of s2 | | main.go:41:2:41:3 | definition of s4 | main.go:42:10:42:11 | s4 | | main.go:41:8:41:21 | call to make | main.go:41:2:41:3 | definition of s4 | | strings.go:8:12:8:12 | argument corresponding to s | strings.go:8:12:8:12 | definition of s | diff --git a/ql/test/library-tests/semmle/go/dataflow/FlowSteps/main.go b/ql/test/library-tests/semmle/go/dataflow/FlowSteps/main.go index a06ef15684f..c6191a73a55 100644 --- a/ql/test/library-tests/semmle/go/dataflow/FlowSteps/main.go +++ b/ql/test/library-tests/semmle/go/dataflow/FlowSteps/main.go @@ -34,10 +34,11 @@ func main() { test1(test2()(), test2()) } -func test9() { +func test9() []int { s := []int{1, 2, 3} s1 := append(s, 4, 5, 6) s2 := append(s, s1...) s4 := make([]int, 4) copy(s, s4) + return s2 }