This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR64820] Fix ASan UAR detection fails on 32-bit targets if SSP is enabled.
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Yury Gribov <y dot gribov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>
- Date: Sun, 15 Mar 2015 20:23:15 +0000
- Subject: Re: [PATCH PR64820] Fix ASan UAR detection fails on 32-bit targets if SSP is enabled.
- Authentication-results: sourceware.org; auth=none
- References: <54D8860A dot 7010903 at partner dot samsung dot com>
Maxim Ostapenko <m.ostapenko@partner.samsung.com> writes:
> @@ -293,17 +302,15 @@ alloc_stack_frame_space (HOST_WIDE_INT size, unsigned HOST_WIDE_INT align)
> new_frame_offset = frame_offset;
Think this assignment is dead after your change.
> if (FRAME_GROWS_DOWNWARD)
> {
> - new_frame_offset -= size + frame_phase;
> - new_frame_offset &= -align;
> - new_frame_offset += frame_phase;
> + new_frame_offset
> + = align_base (frame_offset - frame_phase - size,
> + align, false) + frame_phase;
> offset = new_frame_offset;
> }
> else
> {
> - new_frame_offset -= frame_phase;
> - new_frame_offset += align - 1;
> - new_frame_offset &= -align;
> - new_frame_offset += frame_phase;
> + new_frame_offset
> + = align_base (frame_offset - frame_phase, align, true) + frame_phase;
> offset = new_frame_offset;
> new_frame_offset += size;
> }
(Patch looks good to me otherwise FWIW.)
Thanks,
Richard