File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
cpp/common/src/codingstandards/cpp Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ pragma[inline]
231231ControlFlowNode getAThreadContextAwarePredecessor ( ControlFlowNode start , ControlFlowNode end ) {
232232 result = getAThreadContextAwareSuccessor ( start ) and
233233 not result = getAThreadContextAwareSuccessor ( end ) and
234- not result = end
234+ not result = end
235235}
236236
237237/**
@@ -402,6 +402,13 @@ class LockProtectedControlFlowNode extends ThreadedCFN {
402402 unlock .( MutexFunctionCall ) .isUnlock ( )
403403 // note that we don't check that it's the same lock -- this is left
404404 // to the caller to enforce this condition.
405+
406+ // Because of the way that `getAThreadContextAwarePredecessor` works, it is possible
407+ // for operations PAST it to be technically part of the predecessors.
408+ // Thus, we need to make sure that this lock (to be actually)
409+ // an unlock along the same path it must be the case that when we
410+ // supply it as the starting point of the search it hits the try lock
411+ and getAThreadContextAwareSuccessor ( unlock ) = this
405412 ) and
406413 ( lock instanceof MutexFunctionCall implies not this .( MutexFunctionCall ) .isUnlock ( ) )
407414 )
You can’t perform that action at this time.
0 commit comments