[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user/flatload: fix initial stack pointer
From: |
Max Filippov |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user/flatload: fix initial stack pointer alignment |
Date: |
Wed, 24 Oct 2018 11:30:44 -0700 |
On Wed, Oct 24, 2018 at 10:19 AM Max Filippov <address@hidden> wrote:
>
> On Wed, Oct 24, 2018 at 4:35 AM Laurent Vivier <address@hidden> wrote:
> > > diff --git a/linux-user/flatload.c b/linux-user/flatload.c
> > > index 2eefe55e5000..1893966b5b30 100644
> > > --- a/linux-user/flatload.c
> > > +++ b/linux-user/flatload.c
>
> > > - sp -= 16 - ((sp + stack_len) & 15);
> > > + if ((sp - stack_len) & 15) {
> > > + sp -= ((sp - stack_len) & 15);
> > > + }
> >
> > If I understand correctly the purpose, I think it could be clearer like:
> >
> > sp = (sp - stack_len) & ~15;
>
> Yes, you're right. I'll send v2.
Well, not exactly. The sp is not moved down stack_len + alignment bytes,
only the alignment bytes. I'll send v2 anyway.
--
Thanks.
-- Max