Skip to content

Commit e8684b8

Browse files
committed
#351: fix Z3 with unsat-cores.
The bug was a redundant call to decRef, such that Z3 cleaned up a formula that was still in use. We might actually not require any reference counting in that specific code.
1 parent 5c60f2c commit e8684b8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/org/sosy_lab/java_smt/solvers/z3/Z3AbstractProver.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,18 @@ protected Z3Model getEvaluatorWithoutChecks() {
125125
protected Void addConstraintImpl(BooleanFormula f) throws InterruptedException {
126126
Preconditions.checkState(!closed);
127127
long e = creator.extractInfo(f);
128-
Native.incRef(z3context, e);
129128
try {
130129
if (storedConstraints != null) { // Unsat core generation is on.
131130
String varName = String.format("Z3_UNSAT_CORE_%d", trackId.getFreshId());
132131
BooleanFormula t = mgr.getBooleanFormulaManager().makeVariable(varName);
133-
134132
assertContraintAndTrack(e, creator.extractInfo(t));
135133
storedConstraints.push(storedConstraints.pop().putAndCopy(varName, f));
136-
Native.decRef(z3context, e);
137134
} else {
138135
assertContraint(e);
139136
}
140137
} catch (Z3Exception exception) {
141138
throw creator.handleZ3Exception(exception);
142139
}
143-
Native.decRef(z3context, e);
144140
return null;
145141
}
146142

0 commit comments

Comments
 (0)