Commit f6fa17af by Jakub Jelinek Committed by Jakub Jelinek

re PR sanitizer/88333 (ice in asan_emit_stack_protection, at asan.c:1574)

	PR sanitizer/88333
	* cfgexpand.c (expand_stack_vars): If asan_vec is empty, start with
	aligning frame offset to ASAN_RED_ZONE_SIZE bytes.

	* c-c++-common/asan/pr88333.c: New test.

From-SVN: r266817
parent 47be9509
2018-12-05 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/88333
* cfgexpand.c (expand_stack_vars): If asan_vec is empty, start with
aligning frame offset to ASAN_RED_ZONE_SIZE bytes.
2018-12-05 Xianmiao Qu <xianmiao_qu@c-sky.com> 2018-12-05 Xianmiao Qu <xianmiao_qu@c-sky.com>
* config.gcc (csky-*-linux-gnu*): Force .init_array support. * config.gcc (csky-*-linux-gnu*): Force .init_array support.
...@@ -1124,6 +1124,11 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data) ...@@ -1124,6 +1124,11 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data)
&& frame_offset.is_constant (&prev_offset) && frame_offset.is_constant (&prev_offset)
&& stack_vars[i].size.is_constant ()) && stack_vars[i].size.is_constant ())
{ {
if (data->asan_vec.is_empty ())
{
alloc_stack_frame_space (0, ASAN_RED_ZONE_SIZE);
prev_offset = frame_offset.to_constant ();
}
prev_offset = align_base (prev_offset, prev_offset = align_base (prev_offset,
MAX (alignb, ASAN_MIN_RED_ZONE_SIZE), MAX (alignb, ASAN_MIN_RED_ZONE_SIZE),
!FRAME_GROWS_DOWNWARD); !FRAME_GROWS_DOWNWARD);
......
2018-12-05 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/88333
* c-c++-common/asan/pr88333.c: New test.
2018-12-05 Alexandre Oliva <aoliva@redhat.com> 2018-12-05 Alexandre Oliva <aoliva@redhat.com>
PR c++/85569 PR c++/85569
......
/* PR sanitizer/88333 */
/* { dg-do compile { target fstack_protector } } */
/* { dg-options "-fstack-protector-strong -fsanitize=address" } */
void bar (int *);
void
foo (void)
{
int c;
bar (&c);
}
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