bug fix
authorbdemsky <bdemsky@uci.edu>
Wed, 31 Dec 2014 13:05:39 +0000 (22:05 +0900)
committerbdemsky <bdemsky@uci.edu>
Wed, 31 Dec 2014 13:05:39 +0000 (22:05 +0900)
glucose-syrup/incremental/Main.cc
inc_solver.cc

index acb61b68b07c52e642ef076ee77ffcca02172554..5ea6c13a1c68b5c5a8e9284e036c763b9a852000 100644 (file)
@@ -153,7 +153,6 @@ void processCommands(SimpSolver *solver) {
       if (ret == l_True) {
         putInt(IS_SAT);
         putInt(solver->nVars());
-        putInt(0);
         for(int i=0;i<solver->nVars();i++) {
           putInt(solver->model[i]==l_True);
         }
index 28444bcf6ff702368b24d38a7e6444fd05e4c1e5..24c6e88fcb13030d99cf293998fcd2395dadc210 100644 (file)
@@ -48,9 +48,10 @@ int IncrementalSolver::solve() {
     if (numVars > solutionsize) {
       if (solution != NULL)
         free(solution);
-      solution = (int *) malloc(numVars*sizeof(int));
+      solution = (int *) malloc((numVars+1)*sizeof(int));
+      solution[0] = 0;
     }
-    readSolver(solution, numVars * sizeof(int));
+    readSolver(&solution[1], numVars * sizeof(int));
   }
   return result;
 }