From: marxin Date: Mon, 24 Sep 2018 11:23:35 +0000 (+0000) Subject: Guard memory block allocation. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3b6c6ff34f60419f189b07ef086fc6a646145d3;p=thirdparty%2Fgcc.git Guard memory block allocation. 2018-09-24 Martin Liska * memory-block.h (memory_block_pool::release): Annotate with valgrind that the memory is not accessible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264529 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc16b257d5af..de6973aa3384 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-24 Martin Liska + + * memory-block.h (memory_block_pool::release): Annotate with + valgrind that the memory is not accessible. + 2018-09-24 Martin Liska PR sanitizer/85774 diff --git a/gcc/memory-block.h b/gcc/memory-block.h index 5440428240d0..c045d2e95ab2 100644 --- a/gcc/memory-block.h +++ b/gcc/memory-block.h @@ -68,6 +68,11 @@ memory_block_pool::release (void *uncast_block) block_list *block = new (uncast_block) block_list; block->m_next = instance.m_blocks; instance.m_blocks = block; + + VALGRIND_DISCARD (VALGRIND_MAKE_MEM_NOACCESS ((char *)uncast_block + + sizeof (block_list), + block_size + - sizeof (block_list))); } extern void *mempool_obstack_chunk_alloc (size_t) ATTRIBUTE_MALLOC;