You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.expect("decision depth did not fit in u16, this is likely to be an instrumentation error")
232
-
}
233
-
234
-
// At first we assign ConditionIds for each sub expression.
235
-
// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
236
-
//
237
-
// Example: "x = (A && B) || (C && D) || (D && F)"
238
-
//
239
-
// Visit Depth1:
240
-
// (A && B) || (C && D) || (D && F)
241
-
// ^-------LHS--------^ ^-RHS--^
242
-
// ID=1 ID=2
243
-
//
244
-
// Visit LHS-Depth2:
245
-
// (A && B) || (C && D)
246
-
// ^-LHS--^ ^-RHS--^
247
-
// ID=1 ID=3
248
-
//
249
-
// Visit LHS-Depth3:
250
-
// (A && B)
251
-
// LHS RHS
252
-
// ID=1 ID=4
253
-
//
254
-
// Visit RHS-Depth3:
255
-
// (C && D)
256
-
// LHS RHS
257
-
// ID=3 ID=5
258
-
//
259
-
// Visit RHS-Depth2: (D && F)
260
-
// LHS RHS
261
-
// ID=2 ID=6
262
-
//
263
-
// Visit Depth1:
264
-
// (A && B) || (C && D) || (D && F)
265
-
// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
266
-
//
267
-
// A node ID of '0' always means MC/DC isn't being tracked.
268
-
//
269
-
// If a "next" node ID is '0', it means it's the end of the test vector.
270
-
//
271
-
// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
272
-
// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
273
-
// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
match u16::try_from(self.decision_ctx_stack.len())
106
+
.expect(
107
+
"decision depth did not fit in u16, this is likely to be an instrumentation error",
108
+
)
109
+
.checked_sub(1)
110
+
{
111
+
Some(d) => d,
112
+
None => bug!("Unexpected empty decision stack"),
113
+
}
114
+
}
115
+
116
+
// At first we assign ConditionIds for each sub expression.
117
+
// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
118
+
//
119
+
// Example: "x = (A && B) || (C && D) || (D && F)"
120
+
//
121
+
// Visit Depth1:
122
+
// (A && B) || (C && D) || (D && F)
123
+
// ^-------LHS--------^ ^-RHS--^
124
+
// ID=1 ID=2
125
+
//
126
+
// Visit LHS-Depth2:
127
+
// (A && B) || (C && D)
128
+
// ^-LHS--^ ^-RHS--^
129
+
// ID=1 ID=3
130
+
//
131
+
// Visit LHS-Depth3:
132
+
// (A && B)
133
+
// LHS RHS
134
+
// ID=1 ID=4
135
+
//
136
+
// Visit RHS-Depth3:
137
+
// (C && D)
138
+
// LHS RHS
139
+
// ID=3 ID=5
140
+
//
141
+
// Visit RHS-Depth2: (D && F)
142
+
// LHS RHS
143
+
// ID=2 ID=6
144
+
//
145
+
// Visit Depth1:
146
+
// (A && B) || (C && D) || (D && F)
147
+
// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
148
+
//
149
+
// A node ID of '0' always means MC/DC isn't being tracked.
150
+
//
151
+
// If a "next" node ID is '0', it means it's the end of the test vector.
152
+
//
153
+
// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
154
+
// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
155
+
// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
0 commit comments