File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
go/ql/lib/semmle/go/frameworks Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ module IntegerParser {
117
117
* input is 0 then it means the bit size of `int` and `uint`.
118
118
*/
119
119
FunctionInput getTargetBitSizeInput ( ) { none ( ) }
120
+
121
+ /** Gets whether the function is for parsing signed or unsigned integers. */
122
+ boolean isSigned ( ) { none ( ) }
120
123
}
121
124
}
122
125
Original file line number Diff line number Diff line change @@ -11,20 +11,26 @@ module Strconv {
11
11
Atoi ( ) { this .hasQualifiedName ( "strconv" , "Atoi" ) }
12
12
13
13
override int getTargetBitSize ( ) { result = 0 }
14
+
15
+ override boolean isSigned ( ) { result = true }
14
16
}
15
17
16
18
/** The `ParseInt` function. */
17
19
class ParseInt extends IntegerParser:: Range {
18
20
ParseInt ( ) { this .hasQualifiedName ( "strconv" , "ParseInt" ) }
19
21
20
22
override FunctionInput getTargetBitSizeInput ( ) { result .isParameter ( 2 ) }
23
+
24
+ override boolean isSigned ( ) { result = true }
21
25
}
22
26
23
27
/** The `ParseUint` function. */
24
28
class ParseUint extends IntegerParser:: Range {
25
29
ParseUint ( ) { this .hasQualifiedName ( "strconv" , "ParseUint" ) }
26
30
27
31
override FunctionInput getTargetBitSizeInput ( ) { result .isParameter ( 2 ) }
32
+
33
+ override boolean isSigned ( ) { result = false }
28
34
}
29
35
30
36
/**
You can’t perform that action at this time.
0 commit comments