Commit 05aa6d4a authored by Paul Eggert's avatar Paul Eggert

Fix off-by-1 bug in --enable-checking=stringbytes

Evidently nobody builds Emacs with --enable-checking=all,
which is no surprise as it is so slow as to be unusable nowadays.
Perhaps we should remove the slowest checks, or move them into
another category, or speed them up, or something.
* src/alloc.c (SDATA_SIZE) [GC_CHECK_STRING_BYTES]: Fix off-by-one
error in size calculation, which caused a failure when
--enable-checking=stringbytes was used.  I introduced this bug in
2016-09-08T01:08:45!eggert@cs.ucla.edu "Port flexible array
members to GCC + valgrind".
parent 096f638d
...@@ -1760,7 +1760,7 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = ...@@ -1760,7 +1760,7 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
#ifdef GC_CHECK_STRING_BYTES #ifdef GC_CHECK_STRING_BYTES
#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, NBYTES) #define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, (NBYTES) + 1)
#else /* not GC_CHECK_STRING_BYTES */ #else /* not GC_CHECK_STRING_BYTES */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment