File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -655,7 +655,7 @@ extern "C" {
655
655
result = to_solver_ref (s)->check_sat (num_assumptions, _assumptions);
656
656
}
657
657
catch (z3_exception & ex) {
658
- to_solver_ref (s)->set_reason_unknown (eh);
658
+ to_solver_ref (s)->set_reason_unknown (eh, ex );
659
659
to_solver (s)->set_eh (nullptr );
660
660
if (mk_c (c)->m ().inc ()) {
661
661
mk_c (c)->handle_exception (ex);
@@ -751,8 +751,8 @@ extern "C" {
751
751
try {
752
752
to_solver_ref (s)->get_unsat_core (core);
753
753
}
754
- catch (... ) {
755
- to_solver_ref (s)->set_reason_unknown (eh);
754
+ catch (std:: exception & ex ) {
755
+ to_solver_ref (s)->set_reason_unknown (eh, ex );
756
756
to_solver (s)->set_eh (nullptr );
757
757
if (core.empty ())
758
758
throw ;
@@ -877,7 +877,7 @@ extern "C" {
877
877
}
878
878
catch (z3_exception & ex) {
879
879
to_solver (s)->set_eh (nullptr );
880
- to_solver_ref (s)->set_reason_unknown (eh);
880
+ to_solver_ref (s)->set_reason_unknown (eh, ex );
881
881
_assumptions.finalize (); _consequences.finalize (); _variables.finalize ();
882
882
mk_c (c)->handle_exception (ex);
883
883
return Z3_L_UNDEF;
Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ void check_sat_result::set_reason_unknown(event_handler& eh) {
39
39
}
40
40
}
41
41
42
+ void check_sat_result::set_reason_unknown (event_handler& eh, std::exception & ex) {
43
+ switch (eh.caller_id ()) {
44
+ case UNSET_EH_CALLER:
45
+ if (reason_unknown () == " " )
46
+ set_reason_unknown (ex.what ());
47
+ break ;
48
+ default :
49
+ set_reason_unknown (eh);
50
+ break ;
51
+ }
52
+ }
53
+
42
54
proof* check_sat_result::get_proof () {
43
55
if (!m_log.empty () && !m_proof) {
44
56
SASSERT (is_app (m_log.back ()));
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ class check_sat_result {
69
69
virtual std::string reason_unknown () const = 0;
70
70
virtual void set_reason_unknown (char const * msg) = 0;
71
71
void set_reason_unknown (event_handler& eh);
72
+ void set_reason_unknown (event_handler& eh, std::exception & ex);
72
73
virtual void get_labels (svector<symbol> & r) = 0;
73
74
virtual ast_manager& get_manager () const = 0;
74
75
You can’t perform that action at this time.
0 commit comments