@@ -375,21 +375,20 @@ void symex_target_equationt::convert(
375375 try
376376 {
377377 convert_guards (prop_conv);
378+ convert_assignments (prop_conv);
379+ convert_decls (prop_conv);
380+ convert_assumptions (prop_conv);
381+ convert_assertions (prop_conv);
382+ convert_goto_instructions (prop_conv);
383+ convert_io (prop_conv);
384+ convert_constraints (prop_conv);
378385 }
379- catch (guard_conversion_exceptiont &guard_conversion_exception )
386+ catch (const equation_conversion_exceptiont &conversion_exception )
380387 {
381388 // unwrap the except and throw like normal
382- const std::string full_error = unwrap_exception (guard_conversion_exception );
389+ const std::string full_error = unwrap_exception (conversion_exception );
383390 throw full_error;
384391 }
385-
386- convert_assignments (prop_conv);
387- convert_decls (prop_conv);
388- convert_assumptions (prop_conv);
389- convert_assertions (prop_conv);
390- convert_goto_instructions (prop_conv);
391- convert_io (prop_conv);
392- convert_constraints (prop_conv);
393392}
394393
395394// / converts assignments
@@ -416,7 +415,16 @@ void symex_target_equationt::convert_decls(
416415 {
417416 // The result is not used, these have no impact on
418417 // the satisfiability of the formula.
419- prop_conv.convert (step.cond_expr );
418+ try
419+ {
420+ prop_conv.convert (step.cond_expr );
421+ }
422+ catch (const bitvector_conversion_exceptiont &conversion_exception)
423+ {
424+ util_throw_with_nested (
425+ equation_conversion_exceptiont (
426+ " Error converting decls for step" , step, ns));
427+ }
420428 }
421429 }
422430}
@@ -438,7 +446,9 @@ void symex_target_equationt::convert_guards(
438446 }
439447 catch (const bitvector_conversion_exceptiont &conversion_exception)
440448 {
441- util_throw_with_nested (guard_conversion_exceptiont (step, ns));
449+ util_throw_with_nested (
450+ equation_conversion_exceptiont (
451+ " Error converting guard for step" , step, ns));
442452 }
443453 }
444454 }
@@ -456,7 +466,18 @@ void symex_target_equationt::convert_assumptions(
456466 if (step.ignore )
457467 step.cond_literal =const_literal (true );
458468 else
459- step.cond_literal =prop_conv.convert (step.cond_expr );
469+ {
470+ try
471+ {
472+ step.cond_literal = prop_conv.convert (step.cond_expr );
473+ }
474+ catch (const bitvector_conversion_exceptiont &conversion_exception)
475+ {
476+ util_throw_with_nested (
477+ equation_conversion_exceptiont (
478+ " Error converting assumptions for step" , step, ns));
479+ }
480+ }
460481 }
461482 }
462483}
@@ -473,7 +494,18 @@ void symex_target_equationt::convert_goto_instructions(
473494 if (step.ignore )
474495 step.cond_literal =const_literal (true );
475496 else
476- step.cond_literal =prop_conv.convert (step.cond_expr );
497+ {
498+ try
499+ {
500+ step.cond_literal = prop_conv.convert (step.cond_expr );
501+ }
502+ catch (const bitvector_conversion_exceptiont &conversion_exception)
503+ {
504+ util_throw_with_nested (
505+ equation_conversion_exceptiont (
506+ " Error converting goto instructions for step" , step, ns));
507+ }
508+ }
477509 }
478510 }
479511}
@@ -542,7 +574,16 @@ void symex_target_equationt::convert_assertions(
542574 step.cond_expr );
543575
544576 // do the conversion
545- step.cond_literal =prop_conv.convert (implication);
577+ try
578+ {
579+ step.cond_literal = prop_conv.convert (implication);
580+ }
581+ catch (const bitvector_conversion_exceptiont &conversion_exception)
582+ {
583+ util_throw_with_nested (
584+ equation_conversion_exceptiont (
585+ " Error converting assertions for step" , step, ns));
586+ }
546587
547588 // store disjunct
548589 disjuncts.push_back (literal_exprt (!step.cond_literal ));
0 commit comments