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 {
117117 * input is 0 then it means the bit size of `int` and `uint`.
118118 */
119119 FunctionInput getTargetBitSizeInput ( ) { none ( ) }
120+
121+ /** Gets whether the function is for parsing signed or unsigned integers. */
122+ boolean isSigned ( ) { none ( ) }
120123 }
121124}
122125
Original file line number Diff line number Diff line change @@ -11,20 +11,26 @@ module Strconv {
1111 Atoi ( ) { this .hasQualifiedName ( "strconv" , "Atoi" ) }
1212
1313 override int getTargetBitSize ( ) { result = 0 }
14+
15+ override boolean isSigned ( ) { result = true }
1416 }
1517
1618 /** The `ParseInt` function. */
1719 class ParseInt extends IntegerParser:: Range {
1820 ParseInt ( ) { this .hasQualifiedName ( "strconv" , "ParseInt" ) }
1921
2022 override FunctionInput getTargetBitSizeInput ( ) { result .isParameter ( 2 ) }
23+
24+ override boolean isSigned ( ) { result = true }
2125 }
2226
2327 /** The `ParseUint` function. */
2428 class ParseUint extends IntegerParser:: Range {
2529 ParseUint ( ) { this .hasQualifiedName ( "strconv" , "ParseUint" ) }
2630
2731 override FunctionInput getTargetBitSizeInput ( ) { result .isParameter ( 2 ) }
32+
33+ override boolean isSigned ( ) { result = false }
2834 }
2935
3036 /**
You can’t perform that action at this time.
0 commit comments