From 5d9906e195864dabe30e3b14d0b64af2e02551d4 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 2 Apr 2004 19:29:48 +0000 Subject: [PATCH] Fixed random bugs in the runtime. --- Repair/RepairCompiler/MCC/Runtime/SimpleHash.cc | 2 ++ Repair/RepairCompiler/MCC/Runtime/SimpleHash.h | 4 ++-- Repair/RepairCompiler/MCC/Runtime/buildruntime | 10 ++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Repair/RepairCompiler/MCC/Runtime/SimpleHash.cc b/Repair/RepairCompiler/MCC/Runtime/SimpleHash.cc index 7206571..d420a1c 100755 --- a/Repair/RepairCompiler/MCC/Runtime/SimpleHash.cc +++ b/Repair/RepairCompiler/MCC/Runtime/SimpleHash.cc @@ -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; diff --git a/Repair/RepairCompiler/MCC/Runtime/SimpleHash.h b/Repair/RepairCompiler/MCC/Runtime/SimpleHash.h index 50020d8..e1056f2 100755 --- a/Repair/RepairCompiler/MCC/Runtime/SimpleHash.h +++ b/Repair/RepairCompiler/MCC/Runtime/SimpleHash.h @@ -135,11 +135,11 @@ class SimpleIterator { if (cur->nextarray==0 && index==table->tailindex) return 0; - index++; if (index==ARRAYSIZE) { index=0; cur=cur->nextarray; - } + } else + index++; } if (cur->nodes[index].inuse) return 1; diff --git a/Repair/RepairCompiler/MCC/Runtime/buildruntime b/Repair/RepairCompiler/MCC/Runtime/buildruntime index ca76f74..e586517 100755 --- a/Repair/RepairCompiler/MCC/Runtime/buildruntime +++ b/Repair/RepairCompiler/MCC/Runtime/buildruntime @@ -1,5 +1,7 @@ #!/bin/bash -g++ -c SimpleHash.cc -g++ -c tmap.cc -g++ -c instrument.cc -gcc -c libredblack/redblack.c \ No newline at end of file +g++ -g -c SimpleHash.cc +g++ -g -c tmap.cc +g++ -g -c instrument.cc +gcc -g -c libredblack/redblack.c +gcc -g -c stack.c +g++ -g -c size.cc \ No newline at end of file -- 2.34.1