]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin regtest: ensure no stdout output for memcheck/tests/darwin/deep_badparam
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 26 Dec 2025 13:20:34 +0000 (14:20 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 26 Dec 2025 13:20:34 +0000 (14:20 +0100)
The test was doing a write of an uninit ilocal 32byte char buffer.
This has started outputting junk resulting in a stdout diff. So
make sure that the buffer only contains zeros (but still uninit).
Hope the compiler doesn't get too smart.

memcheck/tests/darwin/deep_badparam.c
memcheck/tests/darwin/deep_badparam.stderr.exp

index 9f12683708be6a93579463d0bc615a113aab9d8c..e86762747c34dabdca7f0d135754343d32dbdfc6 100644 (file)
@@ -5,6 +5,8 @@
 int func_six(int x)
 {
     char b[32];
+    for (int i = 0; i < sizeof(b); ++i)
+       b[i] /= 256;
     int r = write(1, b, sizeof(b));
     return x;
 }
index 3eeddc70c21dfd3a6febcca99401874025c4c631..165c7dbb0a78071d41ac15b32b60a7cd4ec2967e 100644 (file)
@@ -1,12 +1,12 @@
 Syscall param write(buf) points to uninitialised byte(s)
    ...
-   by 0x........: func_six (deep_badparam.c:8)
-   by 0x........: func_five (deep_badparam.c:14)
-   by 0x........: func_four (deep_badparam.c:19)
-   by 0x........: func_three (deep_badparam.c:24)
-   by 0x........: func_two (deep_badparam.c:29)
-   by 0x........: func_one (deep_badparam.c:34)
-   by 0x........: main (deep_badparam.c:39)
+   by 0x........: func_six (deep_badparam.c:10)
+   by 0x........: func_five (deep_badparam.c:16)
+   by 0x........: func_four (deep_badparam.c:21)
+   by 0x........: func_three (deep_badparam.c:26)
+   by 0x........: func_two (deep_badparam.c:31)
+   by 0x........: func_one (deep_badparam.c:36)
+   by 0x........: main (deep_badparam.c:41)
  Address 0x........ is on thread 1's stack
  in frame #1, created by func_six (deep_badparam.c:6)