@@ -33,22 +33,20 @@ class AtomicAccessInFullExpressionOrdering extends Ordering::Configuration {
3333
3434/**
3535 * A read of a variable specified as `_Atomic`.
36- *
36+ *
3737 * Note, it may be accessed directly, or by passing its address into the std atomic functions.
3838 */
3939class AtomicVariableAccess extends VariableAccess {
4040 pragma [ noinline]
41- AtomicVariableAccess ( ) {
42- getTarget ( ) .getType ( ) .hasSpecifier ( "atomic" )
43- }
41+ AtomicVariableAccess ( ) { getTarget ( ) .getType ( ) .hasSpecifier ( "atomic" ) }
4442
4543 /* Get the `atomic_<read|write>()` call this VarAccess occurs in. */
4644 FunctionCall getAtomicFunctionCall ( ) {
4745 exists ( AddressOfExpr addrParent , FunctionCall fc |
4846 fc .getTarget ( ) .getName ( ) .matches ( "__c11_atomic%" ) and
4947 addrParent = fc .getArgument ( 0 ) and
50- addrParent .getAnOperand ( ) = this
51- and result = fc
48+ addrParent .getAnOperand ( ) = this and
49+ result = fc
5250 )
5351 }
5452
@@ -59,8 +57,8 @@ class AtomicVariableAccess extends VariableAccess {
5957 result = getAtomicFunctionCall ( ) .getArgument ( 1 )
6058 or
6159 exists ( AssignExpr assign |
62- assign .getLValue ( ) = this
63- and result = assign .getRValue ( )
60+ assign .getLValue ( ) = this and
61+ result = assign .getRValue ( )
6462 )
6563 }
6664
@@ -75,8 +73,8 @@ class AtomicVariableAccess extends VariableAccess {
7573}
7674
7775from
78- AtomicAccessInFullExpressionOrdering config , FullExpr e , Variable v ,
79- AtomicVariableAccess va1 , AtomicVariableAccess va2
76+ AtomicAccessInFullExpressionOrdering config , FullExpr e , Variable v , AtomicVariableAccess va1 ,
77+ AtomicVariableAccess va2
8078where
8179 not isExcluded ( e , SideEffects3Package:: unsequencedAtomicReadsQuery ( ) ) and
8280 e = va1 .( ConstituentExpr ) .getFullExpr ( ) and
8987 TaintTracking:: localTaint ( DataFlow:: exprNode ( va2 .getARead ( ) ) , DataFlow:: exprNode ( write ) )
9088 ) and
9189 // Impose an ordering, show the first access.
92- va1 .getLocation ( ) .isBefore ( va2 .getLocation ( ) , _)
93- select e , "Atomic variable $@ has a $@ that is unsequenced with $@." ,
94- v , v . getName ( ) , va1 , "previous read" , va2 , "another read"
90+ va1 .getLocation ( ) .isBefore ( va2 .getLocation ( ) , _)
91+ select e , "Atomic variable $@ has a $@ that is unsequenced with $@." , v , v . getName ( ) , va1 ,
92+ "previous read" , va2 , "another read"
0 commit comments