mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-25 17:31:02 +00:00
test/msan/sigwait: Don't silently ignore assertion failures
Summary: As the parent process would return 0 independent of whether the child succeeded, assertions in the child would be ignored. Reviewers: eugenis Reviewed By: eugenis Subscribers: #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D82400
This commit is contained in:
parent
f64dc4e686
commit
16784c0558
@ -4,6 +4,7 @@
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sanitizer/msan_interface.h>
|
||||
@ -19,7 +20,9 @@ void test_sigwait() {
|
||||
|
||||
if (pid_t pid = fork()) {
|
||||
kill(pid, SIGUSR1);
|
||||
_exit(0);
|
||||
int child_stat;
|
||||
wait(&child_stat);
|
||||
_exit(!WIFEXITED(child_stat));
|
||||
} else {
|
||||
int sig;
|
||||
int res = sigwait(&s, &sig);
|
||||
|
Loading…
Reference in New Issue
Block a user