Commit aa5bfa8d by Martin Liska Committed by Martin Liska

Add gcc_assert about stack alignment (PR sanitizer/82517).

2018-01-09  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82517
	* asan.c (shadow_mem_size): Add gcc_assert.

From-SVN: r256378
parent 684684c6
2018-01-09 Martin Liska <mliska@suse.cz>
PR sanitizer/82517
* asan.c (shadow_mem_size): Add gcc_assert.
2018-01-09 Georg-Johann Lay <avr@gjlay.de>
Don't save registers in main().
......
......@@ -1228,6 +1228,11 @@ asan_function_start (void)
static unsigned HOST_WIDE_INT
shadow_mem_size (unsigned HOST_WIDE_INT size)
{
/* It must be possible to align stack variables to granularity
of shadow memory. */
gcc_assert (BITS_PER_UNIT
* ASAN_SHADOW_GRANULARITY <= MAX_SUPPORTED_STACK_ALIGNMENT);
return ROUND_UP (size, ASAN_SHADOW_GRANULARITY) / ASAN_SHADOW_GRANULARITY;
}
......
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