aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-04-21 20:36:56 -0700
committerPaul Eggert2019-04-21 21:16:26 -0700
commit4a5ed6b05a71593cda33af4da44f30eb84b51f30 (patch)
tree68c8308ec6d6e027ed7a4410960a559fa36f65af /src
parentf67bc3f12b8ebe4ff0d133063e3c41ab772dbd45 (diff)
downloademacs-4a5ed6b05a71593cda33af4da44f30eb84b51f30.tar.gz
emacs-4a5ed6b05a71593cda33af4da44f30eb84b51f30.zip
Port dump_bitset_clear to -fsanitize=undefined
* src/pdumper.c (dump_bitset_clear): Pacify -fsanitize=undefined by avoiding memset (NULL, x, 0), which strictly speaking has undefined behavior although it works on all production platforms I know.
Diffstat (limited to 'src')
-rw-r--r--src/pdumper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 3facd523e4a..6ab82769ec9 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4923,7 +4923,8 @@ static void
4923dump_bitset_clear (struct dump_bitset *bitset) 4923dump_bitset_clear (struct dump_bitset *bitset)
4924{ 4924{
4925 int xword_size = sizeof (bitset->bits[0]); 4925 int xword_size = sizeof (bitset->bits[0]);
4926 memset (bitset->bits, 0, bitset->number_words * xword_size); 4926 if (bitset->number_words)
4927 memset (bitset->bits, 0, bitset->number_words * xword_size);
4927} 4928}
4928 4929
4929struct pdumper_loaded_dump_private 4930struct pdumper_loaded_dump_private