]> ocean-lang.org Git - ocean/commitdiff
oceani: change variable name in "free global variables"
authorNeilBrown <neil@brown.name>
Tue, 9 Nov 2021 05:16:31 +0000 (16:16 +1100)
committerNeilBrown <neil@brown.name>
Tue, 9 Nov 2021 05:16:31 +0000 (16:16 +1100)
I'm using 't' as the name for a pointer to a variable.
Using 'v' makes more sense.  (t was short for 'temp').

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani.mdc

index 76c8c9b4efd96414511685e620c4d7b7e849acbd..3aa170bd28978a117f7dc27603339437a37727ca 100644 (file)
@@ -1068,15 +1068,16 @@ need to be freed.  For this we need to be able to find it, so assume that
                context.varlist = b->next;
                free(b);
                while (v) {
-                       struct variable *t = v;
+                       struct variable *next = v->previous;
 
-                       v = t->previous;
-                       if (t->global) {
-                               free_value(t->type, var_value(&context, t));
-                               if (t->depth == 0)
-                                       free_exec(t->where_decl);
+                       if (v->global) {
+                               free_value(v->type, var_value(&context, v));
+                               if (v->depth == 0)
+                                       // This is a global constant
+                                       free_exec(v->where_decl);
                        }
-                       free(t);
+                       free(v);
+                       v = next;
                }
        }