[DTrace-devel] [PATCH] alloca: fix subtraction of two alloca pointers
Eugene Loh
eugene.loh at oracle.com
Mon Sep 1 17:13:49 UTC 2025
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
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);
> +}
More information about the DTrace-devel
mailing list