@@ -740,6 +740,12 @@ class ContentSet extends TContentSet {
740
740
*/
741
741
signature predicate guardChecksSig ( CfgNodes:: AstCfgNode g , CfgNode e , boolean branch ) ;
742
742
743
+ bindingset [ def1, def2]
744
+ pragma [ inline_late]
745
+ private predicate sameSourceVariable ( Ssa:: Definition def1 , Ssa:: Definition def2 ) {
746
+ def1 .getSourceVariable ( ) = def2 .getSourceVariable ( )
747
+ }
748
+
743
749
/**
744
750
* Provides a set of barrier nodes for a guard that validates an expression.
745
751
*
@@ -784,9 +790,9 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
784
790
|
785
791
def .getARead ( ) = testedNode and
786
792
guardChecks ( g , testedNode , branch ) and
787
- def .getSourceVariable ( ) = result .getSourceVariable ( ) and
788
793
guardControlsBlock ( g , call .getBasicBlock ( ) , branch ) and
789
- result .getBasicBlock ( ) .getScope ( ) = call .getExpr ( ) .( MethodCall ) .getBlock ( )
794
+ result .getBasicBlock ( ) .getScope ( ) = call .getExpr ( ) .( MethodCall ) .getBlock ( ) and
795
+ sameSourceVariable ( def , result )
790
796
)
791
797
}
792
798
}
@@ -849,9 +855,9 @@ abstract deprecated class BarrierGuard extends CfgNodes::ExprCfgNode {
849
855
|
850
856
def .getARead ( ) = testedNode and
851
857
this .checks ( testedNode , branch ) and
852
- def .getSourceVariable ( ) = result .getSourceVariable ( ) and
853
858
this .controlsBlock ( call .getBasicBlock ( ) , branch ) and
854
- result .getBasicBlock ( ) .getScope ( ) = call .getExpr ( ) .( MethodCall ) .getBlock ( )
859
+ result .getBasicBlock ( ) .getScope ( ) = call .getExpr ( ) .( MethodCall ) .getBlock ( ) and
860
+ sameSourceVariable ( def , result )
855
861
)
856
862
}
857
863
0 commit comments