]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
initialize iter properly in ast_iterator_begin; move those decls up more
authorWolfgang Bumiller <wry.git@bumiller.com>
Sat, 23 Nov 2013 16:12:44 +0000 (17:12 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sat, 23 Nov 2013 16:12:44 +0000 (17:12 +0100)
parser.c

index 0ff315de88d95c290244e0d95265be673bfd05cc..6abf74433c03f348660fb5fc7c20cd3fd6698da8 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -6128,6 +6128,7 @@ static void ast_iterator_begin(ast_iterator *iter, ast_node *start)
 {
     iter->head = start;
     iter->at = &iter->head;
+    iter->path = NULL;
     vec_push(iter->path, iter->at);
 }
 
@@ -6160,10 +6161,10 @@ static ast_node* ast_iterator_next(ast_iterator *iter)
 static void traverse_that_thing(ast_function *fun)
 {
 #if 1
+    ast_node    *at;
+    size_t       depth;
     ast_iterator iter;
     ast_iterator_begin(&iter, (ast_node*)fun);
-    ast_node *at;
-    size_t depth;
 
     for (at = (ast_node*)fun;
          at;