Skip to content

Commit f95ccd2

Browse files
committed
Remove old-style models of built-in functions
1 parent fcdac0a commit f95ccd2

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

go/ql/lib/semmle/go/frameworks/Stdlib.qll

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -44,58 +44,6 @@ import semmle.go.frameworks.stdlib.TextTabwriter
4444
import semmle.go.frameworks.stdlib.TextTemplate
4545
import semmle.go.frameworks.stdlib.Unsafe
4646

47-
// These are modeled using TaintTracking::FunctionModel because they doesn't have real type signatures,
48-
// and therefore currently have an InvalidType, not a SignatureType, which breaks Models as Data.
49-
/**
50-
* A model of the built-in `append` function, which propagates taint from its arguments to its
51-
* result.
52-
*/
53-
private class AppendFunction extends TaintTracking::FunctionModel {
54-
AppendFunction() { this = Builtin::append() }
55-
56-
override predicate hasTaintFlow(FunctionInput inp, FunctionOutput outp) {
57-
inp.isParameter(_) and outp.isResult()
58-
}
59-
}
60-
61-
/**
62-
* A model of the built-in `copy` function, which propagates taint from its second argument
63-
* to its first.
64-
*/
65-
private class CopyFunction extends TaintTracking::FunctionModel {
66-
CopyFunction() { this = Builtin::copy() }
67-
68-
override predicate hasTaintFlow(FunctionInput inp, FunctionOutput outp) {
69-
inp.isParameter(1) and outp.isParameter(0)
70-
}
71-
}
72-
73-
/**
74-
* A model of the built-in `min` function, which computes the smallest value of a fixed number of
75-
* arguments of ordered types. There is at least one argument and "ordered types" includes e.g.
76-
* strings, so we care about data flow through `min`.
77-
*/
78-
private class MinFunction extends DataFlow::FunctionModel {
79-
MinFunction() { this = Builtin::min_() }
80-
81-
override predicate hasDataFlow(FunctionInput inp, FunctionOutput outp) {
82-
inp.isParameter(_) and outp.isResult()
83-
}
84-
}
85-
86-
/**
87-
* A model of the built-in `max` function, which computes the largest value of a fixed number of
88-
* arguments of ordered types. There is at least one argument and "ordered types" includes e.g.
89-
* strings, so we care about data flow through `max`.
90-
*/
91-
private class MaxFunction extends DataFlow::FunctionModel {
92-
MaxFunction() { this = Builtin::max_() }
93-
94-
override predicate hasDataFlow(FunctionInput inp, FunctionOutput outp) {
95-
inp.isParameter(_) and outp.isResult()
96-
}
97-
}
98-
9947
/** Provides a class for modeling functions which convert strings into integers. */
10048
module IntegerParser {
10149
/**

0 commit comments

Comments
 (0)