emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116082: Apply previous change even if valgrind is n


From: Paul Eggert
Subject: [Emacs-diffs] trunk r116082: Apply previous change even if valgrind is not in use, since it avoids undefined behavior. This is simpler.
Date: Mon, 20 Jan 2014 16:55:31 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116082
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2014-01-20 08:55:28 -0800
message:
  Apply previous change even if valgrind is not in use, since it avoids 
undefined behavior. This is simpler.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/alloc.c                    alloc.c-20091113204419-o5vbwnq5f7feedwu-252
  src/buffer.c                   buffer.c-20091113204419-o5vbwnq5f7feedwu-264
  src/conf_post.h                conf_post.h-20120730211826-q0qbxxwh2emw52hd-1
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-01-20 16:47:41 +0000
+++ b/src/ChangeLog     2014-01-20 16:55:28 +0000
@@ -1,12 +1,9 @@
 2014-01-20  Paul Eggert  <address@hidden>
 
-       Pacify valgrind by initializing buffer redisplay bit.
+       Avoid undefined behavior 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.
+       * buffer.c (Fget_buffer_create): Initialize redisplay bit.
 
        Revert some of the CANNOT_DUMP fix (Bug#16494).
        * lread.c (init_lread): Fix typo: NILP, not !NILP.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2014-01-20 16:47:41 +0000
+++ b/src/alloc.c       2014-01-20 16:55:28 +0000
@@ -48,6 +48,12 @@
 
 #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>

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2014-01-20 16:47:41 +0000
+++ b/src/buffer.c      2014-01-20 16:55:28 +0000
@@ -574,8 +574,7 @@
   BUF_BEG_UNCHANGED (b) = 0;
   *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'.  */
   b->text->inhibit_shrinking = false;
-  if (USE_VALGRIND)
-    b->text->redisplay = false;
+  b->text->redisplay = false;
 
   b->newline_cache = 0;
   b->width_run_cache = 0;

=== modified file 'src/conf_post.h'
--- a/src/conf_post.h   2014-01-20 16:47:41 +0000
+++ b/src/conf_post.h   2014-01-20 16:55:28 +0000
@@ -65,15 +65,6 @@
 # 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]