Fixed a bug in partial_model.cpp where the data was immediately deallocated before...
authorTim King <taking@cs.nyu.edu>
Tue, 1 Jun 2010 16:39:02 +0000 (16:39 +0000)
committerTim King <taking@cs.nyu.edu>
Tue, 1 Jun 2010 16:39:02 +0000 (16:39 +0000)
src/expr/node_builder.h
src/theory/arith/partial_model.cpp

index cefeb2fe2d82971d04f098cc5e371406d0555da0..fcc6bb3645691ae1a8e362bd8f07bf4e63217c55 100644 (file)
@@ -372,8 +372,8 @@ protected:
         // NodeBuilder.
         throw std::bad_alloc();
       }
-      d_nvMaxChildren = d_nv->d_nchildren;
       d_nv = newBlock;
+      d_nvMaxChildren = d_nv->d_nchildren;
     }
   }
 
index c5eb0ad1d4ebafd4113ac8ee7ee5cfddd582554c..4b113257c657a2dcf2d7249bb6b9bf531eb56726 100644 (file)
@@ -203,20 +203,15 @@ void ArithPartialModel::beginRecordingAssignments(){
 void ArithPartialModel::stopRecordingAssignments(bool revert){
   Assert(d_savingAssignments);
 
-  d_savingAssignments = false;
+  d_savingAssignments = false; //
 
   if(revert){
     while(!d_history.empty()){
       pair<TNode, DeltaRational>& curr = d_history.back();
-      d_history.pop_back();
-
-      TNode x = curr.first;
 
-      DeltaRational* c;
-      bool hasAssignment = x.getAttribute(partial_model::Assignment(), c);
-      Assert(hasAssignment);
+      setAssignment(curr.first,curr.second);
 
-      *c = curr.second;
+      d_history.pop_back();
     }
   }else{
     d_history.clear();