/* Adding the flags of the super class */
- if (cd.getSuper()!=null) {
- ClassDescriptor superdesc=cd.getSuperDesc();
-
- for(Iterator it_cflags=superdesc.getFlags();it_cflags.hasNext();) {
+ ClassDescriptor tmp=cd;
+ while(tmp!=null) {
+ for(Iterator it_cflags=tmp.getFlags();it_cflags.hasNext();) {
FlagDescriptor fd = (FlagDescriptor)it_cflags.next();
vFlags.add(fd);
}
+ tmp=tmp.getSuperDesc();
}
- for(Iterator it_cflags=cd.getFlags();it_cflags.hasNext();) {
- FlagDescriptor fd = (FlagDescriptor)it_cflags.next();
- vFlags.add(fd);
- }
if (vFlags.size()!=0) {
flag=new FlagDescriptor[vFlags.size()];
String str=new String();
if (beginIndex>this.count||endIndex>this.count||beginIndex>endIndex) {
// FIXME
- System.printString("Index error: "+this+" "+beginIndex+" "+endIndex+"\n");
+ System.printString("Index error: "+beginIndex+" "+endIndex+" "+count+"\n"+this);
}
str.value=this.value;
str.count=endIndex-beginIndex;
}
} else
continue;
- // if there is no optionals, there is no need to build the rest of the struct
+ // if there are no optionals, there is no need to build the rest of the struct
output.println("struct optionaltaskdescriptor * otdarray"+cdtemp.getSafeSymbol()+"[]={");
c_otd = ((Hashtable)optionaltaskdescriptors.get(cdtemp)).values();
Set<OptionalTaskDescriptor> otdset=sa.getOptions(fs, ti);
- output.print("struct optionaltaskdescriptor * optionaltaskfailure_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+"_array[] = {");
+ output.print("struct optionaltaskdescriptor * optionaltaskfailure_FS"+fscounter+"_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+"_array[] = {");
boolean needcomma=false;
for(Iterator<OptionalTaskDescriptor> otdit=ordertd(otdset).iterator();otdit.hasNext();) {
OptionalTaskDescriptor otd=otdit.next();
}
output.println("};");
- output.print("struct taskfailure taskfailure_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+" = {");
+ output.print("struct taskfailure taskfailure_FS"+fscounter+"_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+" = {");
output.print("&task_"+ti.getTask().getSafeSymbol()+", ");
output.print(ti.getIndex()+", ");
output.print(otdset.size()+", ");
- output.print("optionaltaskfailure_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+"_array");
+ output.print("optionaltaskfailure_FS"+fscounter+"_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex()+"_array");
output.println("};");
}
if (needcomma)
output.print(", ");
needcomma=true;
- output.print("&taskfailure_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex());
+ output.print("&taskfailure_FS"+fscounter+"_"+ti.getTask().getSafeSymbol()+"_"+ti.getIndex());
}
output.println("};\n");
currindex=otd->index;
} else if (currtask!=otd->task||currindex!=otd->index)
break;
- totallength+=otd->numenterflags;
+ totallength+=otd->numenterflags;//1 is to store the lengths
}
pw=currtask->descriptorarray[currindex]->queue;
- enterflags=RUNMALLOC(totallength*sizeof(int));
+ enterflags=RUNMALLOC((totallength+numenterflags)*sizeof(int));
numenterflags=j-start;
offset=0;
#endif
if(debugtask){
printf("ENTER %s count=%d\n",currtpd->task->name, (instaccum-instructioncount));
- {
- int i;
- printf("[%x]\n",currtpd);
- for(i=0;i<currtpd->numParameters;i++) {
- printf("%x ", currtpd->parameterArray[i]);
- }
- printf("\n");
- }
((void (*) (void **)) currtpd->task->taskptr)(taskpointerarray);
printf("EXIT %s count=%d\n",currtpd->task->name, (instaccum-instructioncount));
} else
while(ObjhasNext(&objit)) {
struct ___Object___ * obj=(struct ___Object___ *)Objkey(&objit);
struct ___Object___ * tagptr=obj->___tags___;
+ int nonfailed=Objdata4(&objit);
+ int numflags=Objdata3(&objit);
+ int flags=Objdata2(&objit);
Objnext(&objit);
printf(" Contains %lx\n", obj);
printf(" flag=%d\n", obj->flag);
+#ifdef OPTIONAL
+ printf(" flagsstored=%x\n",flags);
+ printf(" numflags=%d\n", numflags);
+ printf(" nonfailed=%d\n",nonfailed);
+#endif
if (tagptr==NULL) {
} else if (tagptr->type==TAGTYPE) {
printf(" tag=%lx\n",tagptr);