File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,15 @@ import codingstandards.cpp.Concurrency
22
22
class CThreadRoot extends Function {
23
23
CThreadCreateCall threadCreate ;
24
24
25
- CThreadRoot ( ) {
26
- threadCreate .getFunction ( ) = this
27
- }
25
+ CThreadRoot ( ) { threadCreate .getFunction ( ) = this }
28
26
29
27
/* Get a function which is reachable from this function */
30
28
Function getAReachableFunction ( ) { calls * ( result ) }
31
29
32
30
CThreadCreateCall getCThreadCreateCall ( ) { result = threadCreate }
33
31
}
34
32
35
- from CThreadCreateCall tc , CThreadRoot threadRoot
33
+ from CThreadCreateCall tc , CThreadRoot threadRoot
36
34
where
37
35
not isExcluded ( tc , Concurrency6Package:: threadCreatedByThreadQuery ( ) ) and
38
36
tc .getEnclosingFunction ( ) = threadRoot .getAReachableFunction ( )
Original file line number Diff line number Diff line change 28
28
or
29
29
exists ( PointerFieldAccess fa |
30
30
expr = fa and
31
- fa .getQualifier ( ) .getType ( ) .stripTopLevelSpecifiers ( ) .( PointerType ) .getBaseType ( ) .hasSpecifier ( "atomic" ) and
31
+ fa .getQualifier ( )
32
+ .getType ( )
33
+ .stripTopLevelSpecifiers ( )
34
+ .( PointerType )
35
+ .getBaseType ( )
36
+ .hasSpecifier ( "atomic" ) and
32
37
field = fa .getTarget ( )
33
38
)
34
39
)
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ void f(int p) {
78
78
atomic_thread_fence (memory_order_seq_cst * 1 ); // COMPLIANT
79
79
atomic_thread_fence (1 ); // NON-COMPLIANT
80
80
atomic_thread_fence (100 ); // NON-COMPLIANT
81
- atomic_thread_fence (g1 + 1 ); // NON_COMPLIANT[FALSE_NEGATIVE]
81
+ atomic_thread_fence (g1 + 1 ); // NON_COMPLIANT[FALSE_NEGATIVE]
82
82
83
83
// No unsafe flow, currently accepted:
84
84
atomic_thread_fence (p ); // COMPLIANT
You can’t perform that action at this time.
0 commit comments