@@ -314,23 +314,28 @@ void collect_mcdc_controlling_rec(
314
314
else if (src.id ()==ID_not)
315
315
{
316
316
exprt e=to_not_expr (src).op ();
317
- collect_mcdc_controlling_rec (e, conditions, result);
318
- }
319
- else if (is_condition (src))
320
- {
321
- exprt e=src;
322
- std::vector<exprt> new_conditions1=conditions;
323
- new_conditions1.push_back (e);
324
- result.insert (conjunction (new_conditions1));
325
-
326
- // e.make_not();
327
- std::vector<exprt> new_conditions2=conditions;
328
- new_conditions2.push_back (not_exprt (e));
329
- result.insert (conjunction (new_conditions2));
317
+ if (not is_condition (e))
318
+ collect_mcdc_controlling_rec (e, conditions, result);
319
+ else
320
+ {
321
+ // to store a copy of ''src''
322
+ std::vector<exprt> new_conditions1=conditions;
323
+ new_conditions1.push_back (src);
324
+ result.insert (conjunction (new_conditions1));
325
+
326
+ // to store a copy of its negation, i.e., ''e''
327
+ std::vector<exprt> new_conditions2=conditions;
328
+ new_conditions2.push_back (e);
329
+ result.insert (conjunction (new_conditions2));
330
+ }
330
331
}
331
332
else
332
333
{
333
- throw " Unexpected exprt for MC/DC coverage" ;
334
+ /* *
335
+ * It may happen that ''is_condition(src)'' is valid,
336
+ * but we ignore this case here as it can be handled
337
+ * by the routine decision/condition detection.
338
+ **/
334
339
}
335
340
}
336
341
0 commit comments