]> granicus.if.org Git - yasm/commitdiff
Fix 2 major bugs: -b switch caused crash, and all actions got corrupted.
authorPeter Johnson <peter@tortall.net>
Sun, 2 Jun 2002 18:58:38 +0000 (18:58 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 2 Jun 2002 18:58:38 +0000 (18:58 -0000)
svn path=/trunk/yasm/; revision=646

tools/re2c/code.c
tools/re2c/token.h

index 9460e25a31c6afb5241c700955314c861825370a..3a45010b66a5649161ddd9d3c37b2103780ba15d 100644 (file)
@@ -100,7 +100,7 @@ static BitMap *BitMap_first = NULL;
 BitMap *
 BitMap_new(Go *g, State *x)
 {
-    BitMap *b;
+    BitMap *b = malloc(sizeof(BitMap));
     b->go = g;
     b->on = x;
     b->next = BitMap_first;
@@ -137,7 +137,8 @@ void BitMap_gen(FILE *o, uint lb, uint ub){
        memset(bm, 0, n);
        fputs("\tstatic unsigned char yybm[] = {", o);
        for(i = 0; b; i += n){
-           uchar m, j;
+           uchar m;
+           uint j;
            for(m = 0x80; b && m; b = b->next, m >>= 1){
                b->i = i; b->m = m;
                doGen(b->go, b->on, bm-lb, m);
index 9c1e515718da4465849c7d0f654a02f7ee2a05d6..1acf4f44ddbbc576f5efcc380b0c73f7696f5f77 100644 (file)
@@ -22,7 +22,7 @@ static inline Token *
 Token_new(SubStr t, uint l)
 {
     Token *r = malloc(sizeof(Token));
-    Str_copy(&r->text, &t);
+    Str_init(&r->text, &t);
     r->line = l;
     return r;
 }