]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Not labeling temps/blocks if opts_dump isn't specified
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 24 Aug 2012 16:10:41 +0000 (18:10 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 24 Aug 2012 16:10:41 +0000 (18:10 +0200)
ast.c

diff --git a/ast.c b/ast.c
index c039679adb6574d2738ea5588738ac467bc320ee..cfcef8847918554cdc4db6911cdab364b6fbd57d 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -720,10 +720,17 @@ void ast_function_delete(ast_function *self)
 
 const char* ast_function_label(ast_function *self, const char *prefix)
 {
-    size_t id  = (self->labelcount++);
-    size_t len = strlen(prefix);
+    size_t id;
+    size_t len;
+    char  *from;
 
-    char *from = self->labelbuf + sizeof(self->labelbuf)-1;
+    if (!opts_dump)
+        return NULL;
+
+    id  = (self->labelcount++);
+    len = strlen(prefix);
+
+    from = self->labelbuf + sizeof(self->labelbuf)-1;
     *from-- = 0;
     do {
         unsigned int digit = id % 10;