Fixed random bugs in the runtime.
[repair.git] / Repair / RepairCompiler / MCC / Runtime / SimpleHash.cc
index 72065716343abc24a4d92343a1098531671dc25f..d420a1c3934481809934c67d073c10c117be9010 100755 (executable)
@@ -74,6 +74,7 @@ int SimpleList::contains(int data) {
 WorkList::WorkList() {
   head=(struct ListNode *) malloc(sizeof(struct ListNode));
   tail=head;
+  head->next=0;
   headoffset=0;
   tailoffset=0;
 }
@@ -126,6 +127,7 @@ void WorkList::add(int id,int type, int lvalue, int rvalue) {
     head->next=(struct ListNode *)malloc(sizeof(struct ListNode));
     headoffset=0;
     head=head->next;
+    head->next=0;
   }
   head->data[headoffset++]=id;
   head->data[headoffset++]=type;