]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: move ->prepare_type call (back) into val_alloc()
[ocean] / csrc / oceani.mdc
index 7ff26c5f7aac1871ac03b9e1fa2fd79aa9c37bd2..18e593065705ea6324a6ddf68250142df4ec3d72 100644 (file)
@@ -537,6 +537,9 @@ Named type are stored in a simple linked list.  Objects of each type are
        {
                struct value *ret;
 
+               if (t->prepare_type)
+                       t->prepare_type(t);
+
                ret = calloc(1, t->size);
                if (init)
                        memcpy(ret, init, t->size);
@@ -3366,9 +3369,6 @@ it is declared, and error will be raised as the name is created as
                        v = v->merged;
                free_value(v->type, v->val);
                free(v->val);
-               if (v->type->prepare_type)
-                       // FIXME is this the first usage of the type?
-                       v->type->prepare_type(v->type);
                if (b->right) {
                        right = interp_exec(b->right, &rtype);
                        v->val = val_alloc(v->type, &right);