mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Go: add test with Argument[0..2] spec
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
invalidModelRow
|
||||
| Unrecognized input specification "Argument[0..2]" in sink model. |
|
||||
#select
|
||||
| test.go:47:10:47:12 | arg | qltest |
|
||||
| test.go:48:2:48:13 | type assertion | qltest |
|
||||
|
||||
@@ -9,7 +9,8 @@ class SinkModelTest extends SinkModelCsv {
|
||||
[
|
||||
//`namespace; type; subtypes; name; -; ext; input; kind`
|
||||
"github.com/nonexistent/test;B;false;Sink1;;;Argument[0];qltest",
|
||||
"github.com/nonexistent/test;B;false;SinkMethod;;;Argument[-1];qltest"
|
||||
"github.com/nonexistent/test;B;false;SinkMethod;;;Argument[-1];qltest",
|
||||
"github.com/nonexistent/test;B;false;SinkManyArgs;;;Argument[0..2];qltest",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,4 +140,10 @@ func simpleflow() {
|
||||
c4.Set(a.Src1().(string))
|
||||
c4.Set("")
|
||||
b.Sink1(c4.Get()) // $ SPURIOUS: hasTaintFlow="call to Get" // because we currently don't clear content
|
||||
|
||||
arg1 := src
|
||||
arg2 := src
|
||||
arg3 := src
|
||||
arg4 := src
|
||||
b.SinkManyArgs(arg1, arg2, arg3, arg4) // $ hasTaintFlow="arg1" hasTaintFlow="arg2" hasTaintFlow="arg3"
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ func (a *A1) SrcArg(arg interface{}) {}
|
||||
type B interface {
|
||||
Sink1(arg interface{})
|
||||
SinkMethod() interface{}
|
||||
SinkManyArgs(arg1 interface{}, arg2 interface{}, arg3 interface{}, arg4 interface{})
|
||||
}
|
||||
|
||||
type C struct {
|
||||
|
||||
Reference in New Issue
Block a user