public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] alloca: fix subtraction of two alloca pointers
Date: Thu, 11 Sep 2025 16:42:54 -0400	[thread overview]
Message-ID: <aMM0TnMEQNJQARfc@oracle.com> (raw)
In-Reply-To: <ed020c9c-1d0c-8405-b8cc-969324798934@oracle.com>

On Mon, Sep 01, 2025 at 01:13:49PM -0400, Eugene Loh wrote:
> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>

Thanks.

> though...
> 
> On 8/30/25 01:55, Kris Van Hees wrote:
> > diff --git a/test/unittest/funcs/alloca/tst.alloca-arith.d b/test/unittest/funcs/alloca/tst.alloca-arith.d
> > @@ -0,0 +1,29 @@
> > +BEGIN
> > +{
> > +	x = (char *)alloca(1);
> 
> This is okay, but is it dead, vestigial code?

No, it is part of the logic used here and in other tests to ensure that the
alloca mgmt code ensures proper alignment.
> 
> > +	x = (char *)alloca(10);
> > +	y = (char *)alloca(1);
> > +	z = y - x;
> > +	z /= 8;
> 
> This is okay, but how about skipping the /8 and just testing for 16?  If
> you're worried about padding changes in the future(?), then the x alloca()
> could become alloca(16).

Same as above... part of the logic to also verify that alignment is done
right.  In this case, it matters in terms of the pointer subtraction code
which uses the base type size to make the subtraction give the number of
element between the two pointers rather than just bytes.

> > +	exit(z == 2 ? 0 : 1);
> > +}

      reply	other threads:[~2025-09-11 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-30  5:55 [PATCH] alloca: fix subtraction of two alloca pointers Kris Van Hees
2025-09-01 17:13 ` Eugene Loh
2025-09-11 20:42   ` Kris Van Hees [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMM0TnMEQNJQARfc@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox