nother fix
authorLisa Hsu <hsul@eecs.umich.edu>
Fri, 5 Mar 2004 11:14:33 +0000 (06:14 -0500)
committerLisa Hsu <hsul@eecs.umich.edu>
Fri, 5 Mar 2004 11:14:33 +0000 (06:14 -0500)
cpu/exec_context.cc:
    nother little bug...forgot to pop off stack as i read off it
sim/system.cc:
    forgot to pop off stack as i read off it

--HG--
extra : convert_revision : d1f691c0a9f0fa22281c717ee465d8a5f1e45c13

cpu/exec_context.cc
sim/system.cc

index 20ab64bc4f49640f7f5f9f72595168aa5a87ee6b..06bd741f2c379b81ae8dde836759c8a0815f3c4d 100644 (file)
@@ -118,6 +118,8 @@ ExecContext::serialize(ostream &os)
         for (int j=0; j<size; ++j) {
             top = stack->top();
             paramOut(os, csprintf("stackpos[%d]",j), top->name);
+            delete top;
+            stack->pop();
         }
     } else {
         SERIALIZE_SCALAR(ctx);
index 40c841ed58554e2edc4acf4fac65f98f38405b91..9517394626dc7631404f87e17c62e8df626f8fcd 100644 (file)
@@ -148,7 +148,10 @@ System::serialize(std::ostream &os)
             paramOut(os, csprintf("stacksize[%d]",i), size);
             for (int j=0; j<size; ++j) {
                 top = stack->top();
-                paramOut(os, csprintf("ctx[%d].stackpos[%d]",i,j), top->name);
+                paramOut(os, csprintf("ctx[%d].stackpos[%d]",i,j),
+                         top->name);
+                delete top;
+                stack->pop();
             }
         }
     }