@@ -60,6 +60,7 @@ int getMaxDepth(ArrayAggregateLiteral al) {
60
60
else result = 1 + max ( Expr child | child = al .getAnElementExpr ( _) | getMaxDepth ( child ) )
61
61
}
62
62
63
+ // internal recursive predicate for `hasMultipleInitializerExprsForSameIndex`
63
64
predicate hasMultipleInitializerExprsForSameIndexInternal (
64
65
ArrayAggregateLiteral root , Expr e1 , Expr e2
65
66
) {
@@ -73,29 +74,6 @@ predicate hasMultipleInitializerExprsForSameIndexInternal(
73
74
)
74
75
}
75
76
76
- // // internal recursive predicate for `hasMultipleInitializerExprsForSameIndex`
77
- // predicate hasMultipleInitializerExprsForSameIndexInternal(
78
- // ArrayAggregateLiteral al1, ArrayAggregateLiteral al2, Expr out_al1_expr, Expr out_al2_expr
79
- // ) {
80
- // exists(int shared_index, Expr al1_expr, Expr al2_expr |
81
- // // an `Expr` initializing an element of the same index in both `al1` and `al2`
82
- // shared_index = [0 .. al1.getArraySize() - 1] and
83
- // al1_expr = al1.getAnElementExpr(shared_index) and
84
- // al2_expr = al2.getAnElementExpr(shared_index) and
85
- // // but not the same `Expr`
86
- // not al1_expr = al2_expr and
87
- // (
88
- // // case A - the children are not aggregate literals
89
- // // holds if `al1` and `al2` both hold for .getElement[sharedIndex]
90
- // not al1_expr instanceof ArrayAggregateLiteral and
91
- // out_al1_expr = al1_expr and
92
- // out_al2_expr = al2_expr
93
- // or
94
- // // case B - `al1` and `al2` both have an aggregate literal child at the same index, so recurse
95
- // hasMultipleInitializerExprsForSameIndexInternal(al1_expr, al2_expr, out_al1_expr, out_al2_expr)
96
- // )
97
- // )
98
- // }
99
77
/**
100
78
* Holds if `expr1` and `expr2` both initialize the same array element of `root`.
101
79
*/
0 commit comments