Add Set AST Constructor
[satune.git] / src / set.c
index 1bab08e527f97e76c73a5fdc79c5703e4da9ea39..fc056a2e16b95ef9547af781cd800de6956ec461 100644 (file)
--- a/src/set.c
+++ b/src/set.c
@@ -2,7 +2,7 @@
 #include <stddef.h>
 
 Set * allocSet(VarType t, uint64_t* elements, uint num) {
-       Set * tmp=(Set *)ourmalloc(sizeof(struct Set));
+       Set * tmp=(Set *)ourmalloc(sizeof(Set));
        tmp->type=t;
        tmp->isRange=false;
        tmp->low=0;
@@ -12,7 +12,7 @@ Set * allocSet(VarType t, uint64_t* elements, uint num) {
 }
 
 Set * allocSetRange(VarType t, uint64_t lowrange, uint64_t highrange) {
-       Set * tmp=(Set *)ourmalloc(sizeof(struct Set));
+       Set * tmp=(Set *)ourmalloc(sizeof(Set));
        tmp->type=t;
        tmp->isRange=true;
        tmp->low=lowrange;
@@ -22,7 +22,7 @@ Set * allocSetRange(VarType t, uint64_t lowrange, uint64_t highrange) {
 }
 
 void deleteSet(Set * set) {
-       if (set->isRange)
+       if (!set->isRange)
                deleteVectorInt(set->members);
        ourfree(set);
 }