This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH PR64820] Fix ASan UAR detection fails on 32-bit targets if SSP is enabled.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]