File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed
cpp/ql/src/semmle/code/cpp/controlflow/internal Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -60,27 +60,14 @@ private cached module Cached {
6060 not n2 instanceof PrimitiveBasicBlock
6161 }
6262
63- /** Returns the index of `node` in its `PrimitiveBasicBlock`. */
64- private int getMemberIndex ( Node node ) {
65- primitive_basic_block_entry_node ( node ) and
66- result = 0
67- or
68- exists ( Node prev |
69- member_step ( prev , node ) and
70- result = getMemberIndex ( prev ) + 1
71- )
72- }
73-
7463 /** Holds if `node` is the `pos`th control-flow node in primitive basic block `bb`. */
7564 cached
7665 predicate primitive_basic_block_member ( Node node , PrimitiveBasicBlock bb , int pos ) {
77- primitive_basic_block_entry_node ( bb ) and
78- (
79- pos = 0 and
80- node = bb
81- or
82- pos = getMemberIndex ( node ) and
83- member_step + ( bb , node )
66+ primitive_basic_block_entry_node ( bb ) and node = bb and pos = 0
67+ or
68+ exists ( Node prev |
69+ member_step ( prev , node ) and
70+ primitive_basic_block_member ( prev , bb , pos - 1 )
8471 )
8572 }
8673
You can’t perform that action at this time.
0 commit comments