マシンコードモニターで2回アセンブルすると異常終了する問題を修正
[YACASL2.git] / src / label.c
index de37b94..63b6fe5 100644 (file)
@@ -1,10 +1,3 @@
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "cerr.h"
-#include "cmem.h"
-#include "hash.h"
 #include "assemble.h"
 
 /**
@@ -173,6 +166,9 @@ void freelabel()
             FREE(p->label->prog);
             FREE(p->label->label);
             FREE(p->label);
+            if(p == labels[i]) {
+                labels[i] = NULL;
+            }
             FREE(p);
         }
     }