@@ -149,7 +149,7 @@ fn create_mappings<'tcx>(
149
149
true_term : term_for_bcb ( true_bcb) ,
150
150
false_term : term_for_bcb ( false_bcb) ,
151
151
} ,
152
- BcbMappingKind :: MCDCBranch { true_bcb, false_bcb, condition_info } => {
152
+ BcbMappingKind :: MCDCBranch { true_bcb, false_bcb, condition_info, .. } => {
153
153
MappingKind :: MCDCBranch {
154
154
true_term : term_for_bcb ( true_bcb) ,
155
155
false_term : term_for_bcb ( false_bcb) ,
@@ -232,38 +232,42 @@ fn inject_mcdc_statements<'tcx>(
232
232
}
233
233
234
234
// Inject test vector update first because `inject_statement` always insert new statement at head.
235
- for ( end_bcbs, bitmap_idx) in
235
+ for ( end_bcbs, bitmap_idx, decision_depth ) in
236
236
coverage_spans. all_bcb_mappings ( ) . filter_map ( |mapping| match & mapping. kind {
237
- BcbMappingKind :: MCDCDecision { end_bcbs, bitmap_idx, .. } => {
238
- Some ( ( end_bcbs, * bitmap_idx) )
237
+ BcbMappingKind :: MCDCDecision { end_bcbs, bitmap_idx, decision_depth , .. } => {
238
+ Some ( ( end_bcbs, * bitmap_idx, * decision_depth ) )
239
239
}
240
240
_ => None ,
241
241
} )
242
242
{
243
243
for end in end_bcbs {
244
244
let end_bb = basic_coverage_blocks[ * end] . leader_bb ( ) ;
245
- inject_statement ( mir_body, CoverageKind :: TestVectorBitmapUpdate { bitmap_idx } , end_bb) ;
245
+ inject_statement (
246
+ mir_body,
247
+ CoverageKind :: TestVectorBitmapUpdate { bitmap_idx, decision_depth } ,
248
+ end_bb,
249
+ ) ;
246
250
}
247
251
}
248
252
249
- for ( true_bcb, false_bcb, condition_id) in
253
+ for ( true_bcb, false_bcb, condition_id, decision_depth ) in
250
254
coverage_spans. all_bcb_mappings ( ) . filter_map ( |mapping| match mapping. kind {
251
- BcbMappingKind :: MCDCBranch { true_bcb, false_bcb, condition_info } => {
252
- Some ( ( true_bcb, false_bcb, condition_info. condition_id ) )
255
+ BcbMappingKind :: MCDCBranch { true_bcb, false_bcb, condition_info, decision_depth } => {
256
+ Some ( ( true_bcb, false_bcb, condition_info. condition_id , decision_depth ) )
253
257
}
254
258
_ => None ,
255
259
} )
256
260
{
257
261
let true_bb = basic_coverage_blocks[ true_bcb] . leader_bb ( ) ;
258
262
inject_statement (
259
263
mir_body,
260
- CoverageKind :: CondBitmapUpdate { id : condition_id, value : true } ,
264
+ CoverageKind :: CondBitmapUpdate { id : condition_id, value : true , decision_depth } ,
261
265
true_bb,
262
266
) ;
263
267
let false_bb = basic_coverage_blocks[ false_bcb] . leader_bb ( ) ;
264
268
inject_statement (
265
269
mir_body,
266
- CoverageKind :: CondBitmapUpdate { id : condition_id, value : false } ,
270
+ CoverageKind :: CondBitmapUpdate { id : condition_id, value : false , decision_depth } ,
267
271
false_bb,
268
272
) ;
269
273
}
0 commit comments