netbsd-tests: Fix the mmap_truncate_signal test
Add a volatile qualifier in the loop which triggers SIGBUS, as otherwise the compiler is smart enough to elide it, replacing it with a check for page != 0. MFC after: 1 week
This commit is contained in:
@@ -504,7 +504,7 @@ ATF_TC_BODY(mmap_truncate_signal, tc)
|
||||
ATF_REQUIRE(signal(SIGSEGV, map_sighandler) != SIG_ERR);
|
||||
sta = 0;
|
||||
for (i = 0; i < page; i++)
|
||||
sta += map[i];
|
||||
sta += ((volatile char *)map)[i];
|
||||
/* child never will get this far, but the compiler will
|
||||
not know, so better use the values calculated to
|
||||
prevent the access to be optimized out */
|
||||
|
||||
Reference in New Issue
Block a user