diff --git a/tests/Ltest-init-local-signal-lib.c b/tests/Ltest-init-local-signal-lib.c index 45c0e7c1..7474f71f 100644 --- a/tests/Ltest-init-local-signal-lib.c +++ b/tests/Ltest-init-local-signal-lib.c @@ -1,6 +1,6 @@ #include /* To prevent inlining and optimizing away */ -int foo(int* f) { +int foo(volatile int* f) { return *f; } diff --git a/tests/Ltest-init-local-signal.c b/tests/Ltest-init-local-signal.c index d23d66f9..4bde218f 100644 --- a/tests/Ltest-init-local-signal.c +++ b/tests/Ltest-init-local-signal.c @@ -46,12 +46,13 @@ void handler(int num, siginfo_t* info, void* ucontext) { exit(-1); } -int foo(int* f); +int foo(volatile int* f); int main(){ struct sigaction a; memset(&a, 0, sizeof(struct sigaction)); a.sa_sigaction = &handler; + a.sa_flags = SA_SIGINFO; sigaction(SIGSEGV, &a, NULL); foo(NULL);