ElementSet * tmp=(ElementSet *)ourmalloc(sizeof(ElementSet));
GETELEMENTTYPE(tmp)= ELEMSET;
tmp->set=s;
- tmp->encoding=NULL;
allocInlineDefVectorASTNode(GETELEMENTPARENTS(tmp));
+ initElementEncoding(&tmp->encoding, (Element *) tmp);
return &tmp->base;
}
allocInlineDefVectorASTNode(GETELEMENTPARENTS(tmp));
for(uint i=0;i<numArrays;i++)
pushVectorASTNode(GETELEMENTPARENTS(array[i]), (ASTNode *) tmp);
+ initElementEncoding(&tmp->domainencoding, (Element *) tmp);
+ initFunctionEncoding(&tmp->functionencoding, (Element *) tmp);
return &tmp->base;
}
void deleteElement(Element *This) {
switch(GETELEMENTTYPE(This)) {
- case ELEMFUNCRETURN:
- deleteInlineArrayElement(&((ElementFunction *)This)->inputs);
+ case ELEMFUNCRETURN: {
+ ElementFunction *ef = (ElementFunction *) This;
+ deleteInlineArrayElement(&ef->inputs);
+ deleteElementEncoding(&ef->domainencoding);
+ deleteFunctionEncoding(&ef->functionencoding);
break;
+ }
+ case ELEMSET: {
+ ElementSet *es = (ElementSet *) This;
+ deleteElementEncoding(&es->encoding);
+ break;
+ }
default:
;
}
deleteVectorArrayASTNode(GETELEMENTPARENTS(This));
+
ourfree(This);
}