@@ -33,7 +33,7 @@ func lab(s string) (*something, error) {
33
33
}
34
34
num = int (number )
35
35
}
36
- target , err := lookupTarget (& config {}, int32 (num )) // $ hasValueFlow="type conversion "
36
+ target , err := lookupTarget (& config {}, int32 (num )) // $ hasValueFlow="num "
37
37
if err != nil {
38
38
return nil , err
39
39
}
@@ -67,8 +67,8 @@ func testParseInt() {
67
67
if err != nil {
68
68
panic (err )
69
69
}
70
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
71
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
70
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
71
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
72
72
_ = int16 (parsed )
73
73
_ = uint16 (parsed )
74
74
_ = int32 (parsed )
@@ -83,10 +83,10 @@ func testParseInt() {
83
83
if err != nil {
84
84
panic (err )
85
85
}
86
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
87
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
88
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
89
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
86
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
87
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
88
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
89
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
90
90
_ = int32 (parsed )
91
91
_ = uint32 (parsed )
92
92
_ = int64 (parsed )
@@ -99,28 +99,28 @@ func testParseInt() {
99
99
if err != nil {
100
100
panic (err )
101
101
}
102
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
103
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
104
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
105
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
106
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
107
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
102
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
103
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
104
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
105
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
106
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
107
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
108
108
_ = int64 (parsed )
109
109
_ = uint64 (parsed )
110
- _ = int (parsed ) // $ hasValueFlow="type conversion "
111
- _ = uint (parsed ) // $ hasValueFlow="type conversion "
110
+ _ = int (parsed ) // $ hasValueFlow="parsed "
111
+ _ = uint (parsed ) // $ hasValueFlow="parsed "
112
112
}
113
113
{
114
114
parsed , err := strconv .ParseInt ("3456" , 10 , 0 )
115
115
if err != nil {
116
116
panic (err )
117
117
}
118
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
119
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
120
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
121
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
122
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
123
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
118
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
119
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
120
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
121
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
122
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
123
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
124
124
_ = int64 (parsed )
125
125
_ = uint64 (parsed )
126
126
_ = int (parsed )
@@ -134,7 +134,7 @@ func testParseUint() {
134
134
if err != nil {
135
135
panic (err )
136
136
}
137
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
137
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
138
138
_ = uint8 (parsed )
139
139
_ = int16 (parsed )
140
140
_ = uint16 (parsed )
@@ -150,9 +150,9 @@ func testParseUint() {
150
150
if err != nil {
151
151
panic (err )
152
152
}
153
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
154
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
155
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
153
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
154
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
155
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
156
156
_ = uint16 (parsed )
157
157
_ = int32 (parsed )
158
158
_ = uint32 (parsed )
@@ -166,47 +166,47 @@ func testParseUint() {
166
166
if err != nil {
167
167
panic (err )
168
168
}
169
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
170
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
171
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
172
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
173
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
169
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
170
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
171
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
172
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
173
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
174
174
_ = uint32 (parsed )
175
175
_ = int64 (parsed )
176
176
_ = uint64 (parsed )
177
- _ = int (parsed ) // $ hasValueFlow="type conversion "
177
+ _ = int (parsed ) // $ hasValueFlow="parsed "
178
178
_ = uint (parsed )
179
179
}
180
180
{
181
181
parsed , err := strconv .ParseUint ("3456" , 10 , 64 )
182
182
if err != nil {
183
183
panic (err )
184
184
}
185
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
186
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
187
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
188
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
189
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
190
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
191
- _ = int64 (parsed ) // $ hasValueFlow="type conversion "
185
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
186
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
187
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
188
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
189
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
190
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
191
+ _ = int64 (parsed ) // $ hasValueFlow="parsed "
192
192
_ = uint64 (parsed )
193
- _ = int (parsed ) // $ hasValueFlow="type conversion "
194
- _ = uint (parsed ) // $ hasValueFlow="type conversion "
193
+ _ = int (parsed ) // $ hasValueFlow="parsed "
194
+ _ = uint (parsed ) // $ hasValueFlow="parsed "
195
195
}
196
196
{
197
197
parsed , err := strconv .ParseUint ("3456" , 10 , 0 )
198
198
if err != nil {
199
199
panic (err )
200
200
}
201
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
202
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
203
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
204
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
205
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
206
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
207
- _ = int64 (parsed ) // $ hasValueFlow="type conversion "
201
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
202
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
203
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
204
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
205
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
206
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
207
+ _ = int64 (parsed ) // $ hasValueFlow="parsed "
208
208
_ = uint64 (parsed )
209
- _ = int (parsed ) // $ hasValueFlow="type conversion "
209
+ _ = int (parsed ) // $ hasValueFlow="parsed "
210
210
_ = uint (parsed )
211
211
}
212
212
}
@@ -216,12 +216,12 @@ func testAtoi() {
216
216
if err != nil {
217
217
panic (err )
218
218
}
219
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
220
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
221
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
222
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
223
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
224
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
219
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
220
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
221
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
222
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
223
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
224
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
225
225
_ = int64 (parsed )
226
226
_ = uint64 (parsed )
227
227
_ = int (parsed )
@@ -238,8 +238,8 @@ func typeAliases(input string) {
238
238
panic (err )
239
239
}
240
240
// NOTE: byte is uint8
241
- _ = byte (parsed ) // $ hasValueFlow="type conversion "
242
- _ = customInt (parsed ) // $ hasValueFlow="type conversion "
241
+ _ = byte (parsed ) // $ hasValueFlow="parsed "
242
+ _ = customInt (parsed ) // $ hasValueFlow="parsed "
243
243
}
244
244
}
245
245
@@ -253,13 +253,13 @@ func testBoundsChecking(input string) {
253
253
_ = int8 (parsed )
254
254
}
255
255
if parsed < math .MaxInt8 {
256
- _ = int8 (parsed ) // $ MISSING: hasValueFlow="type conversion " // Not found because we only check for upper bounds
256
+ _ = int8 (parsed ) // $ MISSING: hasValueFlow="parsed " // Not found because we only check for upper bounds
257
257
if parsed >= 0 {
258
258
_ = int16 (parsed )
259
259
}
260
260
}
261
261
if parsed >= math .MinInt8 {
262
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
262
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
263
263
if parsed <= 0 {
264
264
_ = int16 (parsed )
265
265
}
@@ -276,46 +276,46 @@ func testBoundsChecking(input string) {
276
276
panic (err )
277
277
}
278
278
if parsed <= math .MaxUint64 {
279
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
280
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
281
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
282
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
283
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
284
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
285
- _ = int64 (parsed ) // $ hasValueFlow="type conversion "
279
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
280
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
281
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
282
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
283
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
284
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
285
+ _ = int64 (parsed ) // $ hasValueFlow="parsed "
286
286
_ = uint64 (parsed )
287
- _ = int (parsed ) // $ hasValueFlow="type conversion "
287
+ _ = int (parsed ) // $ hasValueFlow="parsed "
288
288
_ = uint (parsed )
289
289
}
290
290
if parsed <= math .MaxInt64 {
291
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
292
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
293
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
294
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
295
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
296
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
291
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
292
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
293
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
294
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
295
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
296
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
297
297
_ = int64 (parsed )
298
298
_ = uint64 (parsed )
299
- _ = int (parsed ) // $ hasValueFlow="type conversion "
299
+ _ = int (parsed ) // $ hasValueFlow="parsed "
300
300
_ = uint (parsed )
301
301
}
302
302
if parsed <= math .MaxUint32 {
303
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
304
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
305
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
306
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
307
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
303
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
304
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
305
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
306
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
307
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
308
308
_ = uint32 (parsed )
309
309
_ = int64 (parsed )
310
310
_ = uint64 (parsed )
311
- _ = int (parsed ) // $ hasValueFlow="type conversion "
311
+ _ = int (parsed ) // $ hasValueFlow="parsed "
312
312
_ = uint (parsed )
313
313
}
314
314
if parsed <= math .MaxInt32 {
315
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
316
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
317
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
318
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
315
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
316
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
317
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
318
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
319
319
_ = int32 (parsed )
320
320
_ = uint32 (parsed )
321
321
_ = int64 (parsed )
@@ -331,19 +331,19 @@ func testBoundsChecking(input string) {
331
331
}
332
332
if parsed <= math .MaxUint16 {
333
333
_ = uint16 (parsed )
334
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
334
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
335
335
}
336
336
if parsed <= 255 {
337
337
_ = uint8 (parsed )
338
338
}
339
339
if parsed <= 256 {
340
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
340
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
341
341
}
342
342
if err == nil && 1 == 1 && parsed < math .MaxInt8 {
343
343
_ = int8 (parsed )
344
344
}
345
345
if parsed > 42 {
346
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
346
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
347
347
}
348
348
if parsed >= math .MaxUint8 + 1 {
349
349
return
@@ -393,7 +393,7 @@ func testRightShifted(input string) {
393
393
if err != nil {
394
394
panic (err )
395
395
}
396
- _ = byte (parsed ) // $ hasValueFlow="type conversion "
396
+ _ = byte (parsed ) // $ hasValueFlow="parsed "
397
397
_ = byte (parsed << 8 )
398
398
}
399
399
}
@@ -404,15 +404,15 @@ func testPathWithMoreThanOneSink(input string) {
404
404
if err != nil {
405
405
panic (err )
406
406
}
407
- v1 := int16 (parsed ) // $ hasValueFlow="type conversion "
407
+ v1 := int16 (parsed ) // $ hasValueFlow="parsed "
408
408
_ = int16 (v1 )
409
409
}
410
410
{
411
411
parsed , err := strconv .ParseInt (input , 10 , 32 )
412
412
if err != nil {
413
413
panic (err )
414
414
}
415
- v := int16 (parsed ) // $ hasValueFlow="type conversion "
415
+ v := int16 (parsed ) // $ hasValueFlow="parsed "
416
416
_ = int8 (v )
417
417
}
418
418
{
@@ -421,7 +421,7 @@ func testPathWithMoreThanOneSink(input string) {
421
421
panic (err )
422
422
}
423
423
v1 := int32 (parsed )
424
- v2 := int16 (v1 ) // $ hasValueFlow="type conversion "
424
+ v2 := int16 (v1 ) // $ hasValueFlow="v1 "
425
425
_ = int8 (v2 )
426
426
}
427
427
{
@@ -432,7 +432,7 @@ func testPathWithMoreThanOneSink(input string) {
432
432
v1 := int64 (parsed )
433
433
v2 := int32 (v1 )
434
434
v3 := int16 (v2 )
435
- _ = int8 (v3 ) // $ hasValueFlow="type conversion "
435
+ _ = int8 (v3 ) // $ hasValueFlow="v3 "
436
436
}
437
437
}
438
438
@@ -441,12 +441,12 @@ func testUsingStrConvIntSize(input string) {
441
441
if err != nil {
442
442
panic (err )
443
443
}
444
- _ = int8 (parsed ) // $ hasValueFlow="type conversion "
445
- _ = uint8 (parsed ) // $ hasValueFlow="type conversion "
446
- _ = int16 (parsed ) // $ hasValueFlow="type conversion "
447
- _ = uint16 (parsed ) // $ hasValueFlow="type conversion "
448
- _ = int32 (parsed ) // $ hasValueFlow="type conversion "
449
- _ = uint32 (parsed ) // $ hasValueFlow="type conversion "
444
+ _ = int8 (parsed ) // $ hasValueFlow="parsed "
445
+ _ = uint8 (parsed ) // $ hasValueFlow="parsed "
446
+ _ = int16 (parsed ) // $ hasValueFlow="parsed "
447
+ _ = uint16 (parsed ) // $ hasValueFlow="parsed "
448
+ _ = int32 (parsed ) // $ hasValueFlow="parsed "
449
+ _ = uint32 (parsed ) // $ hasValueFlow="parsed "
450
450
_ = int64 (parsed )
451
451
_ = uint64 (parsed )
452
452
_ = int (parsed )
0 commit comments