@@ -12,13 +12,16 @@ Author: Daniel Kroening, kroening@kroening.com
1212#include " symex_target_equation.h"
1313
1414#include < util/std_expr.h>
15+ #include < util/unwrap_nested_exception.h>
1516
1617#include < langapi/language_util.h>
1718#include < solvers/prop/prop_conv.h>
1819#include < solvers/prop/prop.h>
1920#include < solvers/prop/literal_expr.h>
21+ #include < solvers/flattening/bv_conversion_exceptions.h>
2022
2123#include " goto_symex_state.h"
24+ #include " equation_conversion_exceptions.h"
2225
2326// / read from a shared variable
2427void symex_target_equationt::shared_read (
@@ -368,7 +371,17 @@ void symex_target_equationt::constraint(
368371void symex_target_equationt::convert (
369372 prop_convt &prop_conv)
370373{
371- convert_guards (prop_conv);
374+ try
375+ {
376+ convert_guards (prop_conv);
377+ }
378+ catch (guard_conversion_exceptiont &guard_conversion_exception)
379+ {
380+ // unwrap the except and throw like normal
381+ const std::string full_error = unwrap_exception (guard_conversion_exception);
382+ throw full_error;
383+ }
384+
372385 convert_assignments (prop_conv);
373386 convert_decls (prop_conv);
374387 convert_assumptions (prop_conv);
@@ -417,7 +430,16 @@ void symex_target_equationt::convert_guards(
417430 if (step.ignore )
418431 step.guard_literal =const_literal (false );
419432 else
420- step.guard_literal =prop_conv.convert (step.guard );
433+ {
434+ try
435+ {
436+ step.guard_literal = prop_conv.convert (step.guard );
437+ }
438+ catch (const bitvector_conversion_exceptiont &conversion_exception)
439+ {
440+ std::throw_with_nested (guard_conversion_exceptiont (step));
441+ }
442+ }
421443 }
422444}
423445
0 commit comments