From cfb27a1fc44de6ae3835ad8f582ecdc02ac583da Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 17 Jul 1999 18:25:38 +0000 Subject: [PATCH] Get bits of odd sized hex representation. --- lexor.lex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lexor.lex b/lexor.lex index 0c6db91de..069266914 100644 --- a/lexor.lex +++ b/lexor.lex @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: lexor.lex,v 1.32 1999/07/11 17:15:16 steve Exp $" +#ident "$Id: lexor.lex,v 1.33 1999/07/17 18:25:38 steve Exp $" #endif //# define YYSTYPE lexval @@ -651,12 +651,12 @@ static verinum*make_sized_hex(const char*txt) while (*ptr && ((*ptr == ' ') || (*ptr == '\t'))) ptr += 1; - verinum::V*bits = new verinum::V[size]; + verinum::V*bits = new verinum::V[(size+3)&~3]; unsigned idx = 0; char*eptr = ptr + strlen(ptr) - 1; - while ((eptr >= ptr) && (idx <= (size-4))) { + while ((eptr >= ptr) && (idx < size)) { switch (*eptr) { case 'x': case 'X': bits[idx++] = verinum::Vx;