From: Julian Seward Date: Thu, 9 May 2002 01:32:57 +0000 (+0000) Subject: Fix off-by-one error in definition of MAX_LINENO and MAX_LOC_SIZE. X-Git-Tag: svn/VALGRIND_1_0_3~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8d97d9e36db3b5e949137decd87fc02b43777b3;p=thirdparty%2Fvalgrind.git Fix off-by-one error in definition of MAX_LINENO and MAX_LOC_SIZE. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@239 --- diff --git a/coregrind/vg_symtab2.c b/coregrind/vg_symtab2.c index cc37053862..d7257a4085 100644 --- a/coregrind/vg_symtab2.c +++ b/coregrind/vg_symtab2.c @@ -83,10 +83,10 @@ typedef #define LINENO_BITS 20 #define LOC_SIZE_BITS (32 - LINENO_BITS) -#define MAX_LINENO (1 << LINENO_BITS) +#define MAX_LINENO ((1 << LINENO_BITS) - 1) /* Unlikely to have any lines with instruction ranges > 4096 bytes */ -#define MAX_LOC_SIZE (1 << LOC_SIZE_BITS) +#define MAX_LOC_SIZE ((1 << LOC_SIZE_BITS) - 1) /* Number used to detect line number overflows; if one line is 60000-odd * smaller than the previous, is was probably an overflow. diff --git a/vg_symtab2.c b/vg_symtab2.c index cc37053862..d7257a4085 100644 --- a/vg_symtab2.c +++ b/vg_symtab2.c @@ -83,10 +83,10 @@ typedef #define LINENO_BITS 20 #define LOC_SIZE_BITS (32 - LINENO_BITS) -#define MAX_LINENO (1 << LINENO_BITS) +#define MAX_LINENO ((1 << LINENO_BITS) - 1) /* Unlikely to have any lines with instruction ranges > 4096 bytes */ -#define MAX_LOC_SIZE (1 << LOC_SIZE_BITS) +#define MAX_LOC_SIZE ((1 << LOC_SIZE_BITS) - 1) /* Number used to detect line number overflows; if one line is 60000-odd * smaller than the previous, is was probably an overflow.