From d8d97d9e36db3b5e949137decd87fc02b43777b3 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Thu, 9 May 2002 01:32:57 +0000 Subject: [PATCH] Fix off-by-one error in definition of MAX_LINENO and MAX_LOC_SIZE. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@239 --- coregrind/vg_symtab2.c | 4 ++-- vg_symtab2.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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. -- 2.47.2