Skip to content

Commit 54f38d0

Browse files
fix #4235
1 parent 6a61e8d commit 54f38d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/opt/maxlex.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ namespace opt {
5252
ast_manager& m;
5353
maxsat_context& m_c;
5454

55-
void update_assignment() {
55+
bool update_assignment() {
5656
model_ref mdl;
5757
s().get_model(mdl);
5858
if (mdl) {
5959
m_model = mdl;
6060
m_c.model_updated(mdl.get());
6161
update_assignment(mdl);
6262
}
63+
return mdl.get() != nullptr;
6364
}
6465

6566
void assert_value(soft& soft) {
@@ -158,7 +159,8 @@ namespace opt {
158159
lbool is_sat = s().check_sat(asms);
159160
switch (is_sat) {
160161
case l_true:
161-
update_assignment();
162+
if (!update_assignment())
163+
return l_undef;
162164
SASSERT(soft.value == l_true || m.limit().get_cancel_flag());
163165
break;
164166
case l_false:

0 commit comments

Comments
 (0)