Sorry for the earlier OK, was replying to the wrong message…

Matthew Malcomson <matthew.malcom...@arm.com> writes:
> @@ -1216,6 +1255,24 @@ expand_stack_vars (bool (*pred) (size_t), class 
> stack_vars_data *data)
>           {
>             offset = alloc_stack_frame_space (stack_vars[i].size, alignb);
>             base_align = crtl->max_used_stack_slot_alignment;
> +
> +           if (hwasan_sanitize_stack_p ())
> +             {
> +               /* Align again since the point of this alignment is to handle
> +                  the "end" of the object (i.e. smallest address after the
> +                  stack object).  For FRAME_GROWS_DOWNWARD that requires
> +                  aligning the stack before allocating, but for a frame that
> +                  grows upwards that requires aligning the stack after
> +                  allocation.
> +
> +                  Use `frame_offset` to record the offset value rather than
> +                  offset since the `frame_offset` describes the extent

What I meant here was to quote “offset”, i.e.:

                     Use `frame_offset` to record the offset value rather than
                     `offset` since `frame_offset` describes the extent

Without the quoting, “the offset value rather than offset” was quite
hard to parse.

OK with that change, thanks.

Richard

> +                  allocated for this particular variable while `offset`
> +                  describes the address that this variable starts at.  */
> +               align_frame_offset (HWASAN_TAG_GRANULE_SIZE);
> +               hwasan_record_stack_var (virtual_stack_vars_rtx, base,
> +                                        hwasan_orig_offset, frame_offset);
> +             }
>           }
>       }
>        else

Reply via email to