diff options
author | Peter Johnson <peter@tortall.net> | 2007-12-15 00:00:55 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2007-12-15 00:00:55 +0000 |
commit | f210b61533980c6d1405338eafab6472ef7642d3 (patch) | |
tree | 40941f9b4b78894e74d31e22f89250748875338b /tools | |
parent | 8370e6efa974f560e7b69c0f60544a7368e74547 (diff) | |
download | yasm-f210b61533980c6d1405338eafab6472ef7642d3.tar.gz |
re2c: Fix -b generation in certain cases.
Fix from re2c repo r417 (sourceforge bug 1479044).
svn path=/trunk/yasm/; revision=2025
Diffstat (limited to 'tools')
-rw-r--r-- | tools/re2c/code.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/re2c/code.c b/tools/re2c/code.c index 1c72517a..a3341cb4 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -146,11 +146,11 @@ void BitMap_gen(FILE *o, unsigned int lb, unsigned int ub){ unsigned int n = ub - lb; unsigned int i; unsigned char *bm = malloc(sizeof(unsigned char)*n); - memset(bm, 0, n); fputs("\tstatic unsigned char yybm[] = {", o); for(i = 0; b; i += n){ unsigned char m; unsigned int j; + memset(bm, 0, n); for(m = 0x80; b && m; b = b->next, m >>= 1){ b->i = i; b->m = m; doGen(b->go, b->on, bm-lb, m); @@ -161,6 +161,7 @@ void BitMap_gen(FILE *o, unsigned int lb, unsigned int ub){ } } fputs("\n\t};\n", o); oline+=2; + free(bm); } } |