@@ -46,10 +46,13 @@ predicate hasUpperBoundsCheck(Variable var) {
4646 )
4747}
4848
49- predicate nodeIsBarrierEqualityCandidate ( DataFlow:: Node node , Operand access , Variable checkedVar ) {
50- exists ( Instruction instr | instr = node .asOperand ( ) .getDef ( ) |
51- readsVariable ( instr , checkedVar ) and
52- any ( IRGuardCondition guard ) .ensuresEq ( access , _, _, instr .getBlock ( ) , true )
49+ predicate nodeHasBarrierEquality ( DataFlow:: Node node ) {
50+ exists ( Variable checkedVar , Operand access |
51+ readsVariable ( access .getDef ( ) , checkedVar ) and
52+ exists ( Instruction instr | instr = node .asOperand ( ) .getDef ( ) |
53+ readsVariable ( pragma [ only_bind_into ] ( instr ) , pragma [ only_bind_into ] ( checkedVar ) ) and
54+ any ( IRGuardCondition guard ) .ensuresEq ( access , _, _, instr .getBlock ( ) , true )
55+ )
5356 )
5457}
5558
@@ -76,10 +79,7 @@ module TaintedAllocationSizeConfig implements DataFlow::ConfigSig {
7679 hasUpperBoundsCheck ( checkedVar )
7780 )
7881 or
79- exists ( Variable checkedVar , Operand access |
80- readsVariable ( access .getDef ( ) , checkedVar ) and
81- nodeIsBarrierEqualityCandidate ( node , access , checkedVar )
82- )
82+ nodeHasBarrierEquality ( node )
8383 or
8484 // block flow to inside of identified allocation functions (this flow leads
8585 // to duplicate results)
0 commit comments