Re: [PATCH] alloca: fix subtraction of two alloca pointers

Eugene Loh <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <[email protected]>
Reviewed-by: Eugene Loh <[email protected]>
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?

> +	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).

> +	exit(z == 2 ? 0 : 1);
> +}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.