File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
cpp/ql/src/semmle/code/cpp/dataflow/internal Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -292,17 +292,23 @@ module FlowVar_internal {
292292 * Gets a variable that is assigned in this loop and read outside the loop.
293293 */
294294 private Variable getARelevantVariable ( ) {
295- exists ( BasicBlock bbAssign |
296- assignmentLikeOperation ( bbAssign .getANode ( ) , result , _) and
297- this .bbInLoop ( bbAssign )
298- ) and
295+ result = this .getAVariableAssignedInLoop ( ) and
299296 exists ( VariableAccess va |
300297 va .getTarget ( ) = result and
301298 readAccess ( va ) and
302299 bbNotInLoop ( va .getBasicBlock ( ) )
303300 )
304301 }
305302
303+ /** Gets a variable that is assigned in this loop. */
304+ pragma [ noinline]
305+ private Variable getAVariableAssignedInLoop ( ) {
306+ exists ( BasicBlock bbAssign |
307+ assignmentLikeOperation ( bbAssign .getANode ( ) , result , _) and
308+ this .bbInLoop ( bbAssign )
309+ )
310+ }
311+
306312 private predicate bbInLoopCondition ( BasicBlock bb ) {
307313 getCFNParent * ( bb .getANode ( ) ) = this .( Loop ) .getCondition ( )
308314 }
You can’t perform that action at this time.
0 commit comments