@@ -210,9 +210,8 @@ private class MaxValueState extends TMaxValueState {
210
210
* we should use 32 bits, because that will find results that only exist on
211
211
* 32-bit architectures.
212
212
*/
213
- bindingset [ default]
214
- int getSinkBitSize ( int default ) {
215
- if this = TMkMaxValueState ( _, TMk64Bit ( ) ) then result = 64 else result = default
213
+ int getSinkBitSize ( ) {
214
+ if this = TMkMaxValueState ( _, TMk64Bit ( ) ) then result = 64 else result = 32
216
215
}
217
216
218
217
/** Gets a textual representation of this element. */
@@ -341,9 +340,7 @@ class UpperBoundCheck extends BarrierFlowStateTransformer {
341
340
}
342
341
343
342
override predicate barrierFor ( MaxValueState flowstate ) {
344
- // Use a default value of 32 for `MaxValueState.getSinkBitSize` because
345
- // this will find results that only exist on 32-bit architectures.
346
- g .isBoundFor ( flowstate .getBitSize ( ) , flowstate .getSinkBitSize ( 32 ) )
343
+ g .isBoundFor ( flowstate .getBitSize ( ) , flowstate .getSinkBitSize ( ) )
347
344
}
348
345
349
346
override MaxValueState transform ( MaxValueState state ) {
@@ -352,9 +349,7 @@ class UpperBoundCheck extends BarrierFlowStateTransformer {
352
349
max ( int bitsize |
353
350
bitsize = validBitSize ( ) and
354
351
bitsize < state .getBitSize ( ) and
355
- // Use a default value of 32 for `MaxValueState.getSinkBitSize` because
356
- // this will find results that only exist on 32-bit architectures.
357
- not g .isBoundFor ( bitsize , state .getSinkBitSize ( 32 ) )
352
+ not g .isBoundFor ( bitsize , state .getSinkBitSize ( ) )
358
353
) and
359
354
(
360
355
result .getArchitectureBitSize ( ) = state .getArchitectureBitSize ( )
@@ -428,9 +423,7 @@ private module ConversionWithoutBoundsCheckConfig implements DataFlow::StateConf
428
423
additional predicate isSink2 ( DataFlow:: TypeCastNode sink , FlowState state ) {
429
424
sink .asExpr ( ) instanceof ConversionExpr and
430
425
exists ( int architectureBitSize , IntegerType integerType , int sinkBitsize , boolean sinkIsSigned |
431
- // Use a default value of 32 for `MaxValueState.getSinkBitSize` because
432
- // this will find results that only exist on 32-bit architectures.
433
- architectureBitSize = getIntTypeBitSize ( sink .getFile ( ) , state .getSinkBitSize ( 32 ) ) and
426
+ architectureBitSize = getIntTypeBitSize ( sink .getFile ( ) , state .getSinkBitSize ( ) ) and
434
427
not ( state .getArchitectureBitSize ( ) = 32 and architectureBitSize = 64 ) and
435
428
sink .getResultType ( ) .getUnderlyingType ( ) = integerType and
436
429
(
0 commit comments