Commit 3c35702f authored by Paul Eggert's avatar Paul Eggert
Browse files

Pacify valgrind by initializing buffer redisplay bit.

Problem reported by Dmitry Antipov in
<http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01756.html>.
* alloc.c (USE_VALGRIND): Move this to ...
* conf_post.h (USE_VALGRIND): ... here.  Use booleans.
* buffer.c (Fget_buffer_create): Initialize redisplay bit
to pacify valgrind.
parent 71f16bda
2014-01-20 Paul Eggert <eggert@cs.ucla.edu>
Pacify valgrind by initializing buffer redisplay bit.
Problem reported by Dmitry Antipov in
<http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01756.html>.
* alloc.c (USE_VALGRIND): Move this to ...
* conf_post.h (USE_VALGRIND): ... here. Use booleans.
* buffer.c (Fget_buffer_create): Initialize redisplay bit
to pacify valgrind.
Revert some of the CANNOT_DUMP fix (Bug#16494).
* lread.c (init_lread): Fix typo: NILP, not !NILP.
......
......@@ -48,12 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <verify.h>
#if (defined ENABLE_CHECKING \
&& defined HAVE_VALGRIND_VALGRIND_H \
&& !defined USE_VALGRIND)
# define USE_VALGRIND 1
#endif
#if USE_VALGRIND
#include <valgrind/valgrind.h>
#include <valgrind/memcheck.h>
......
......@@ -573,7 +573,9 @@ even if it is dead. The return value is never nil. */)
BUF_END_UNCHANGED (b) = 0;
BUF_BEG_UNCHANGED (b) = 0;
*(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */
b->text->inhibit_shrinking = 0;
b->text->inhibit_shrinking = false;
if (USE_VALGRIND)
b->text->redisplay = false;
b->newline_cache = 0;
b->width_run_cache = 0;
......
......@@ -65,6 +65,15 @@ typedef bool bool_bf;
# define ADDRESS_SANITIZER false
#endif
/* True if Emacs might be run under valgrind. */
#ifndef USE_VALGRIND
# if defined ENABLE_CHECKING && defined HAVE_VALGRIND_VALGRIND_H
# define USE_VALGRIND true
# else
# define USE_VALGRIND false
# endif
#endif
#ifdef DARWIN_OS
#ifdef emacs
#define malloc unexec_malloc
......
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