diff options
author | 2017-07-27 12:31:09 +0000 | |
---|---|---|
committer | 2017-07-27 12:31:09 +0000 | |
commit | d60f87b90b61195911d7f7daf6da6231b052d42d (patch) | |
tree | d4f64bcef549a3a26234f8a02ad0e7553c0f11e1 /regress/lib/libc | |
parent | Export RTAX_IFP, RTAX_IFA and RTAX_LABEL to userland in rtdeletemsg(). (diff) | |
download | wireguard-openbsd-d60f87b90b61195911d7f7daf6da6231b052d42d.tar.xz wireguard-openbsd-d60f87b90b61195911d7f7daf6da6231b052d42d.zip |
Mark the invalid memory location as volatile, otherwise clang would
optimize the access to it with an illegal instruction. But the
tests needs a SIGSEGV, it would fail with SIGILL.
Diffstat (limited to 'regress/lib/libc')
-rw-r--r-- | regress/lib/libc/setjmp-signal/setjmp-signal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/lib/libc/setjmp-signal/setjmp-signal.c b/regress/lib/libc/setjmp-signal/setjmp-signal.c index 310e4052eff..b50f6b27c53 100644 --- a/regress/lib/libc/setjmp-signal/setjmp-signal.c +++ b/regress/lib/libc/setjmp-signal/setjmp-signal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp-signal.c,v 1.3 2003/01/03 20:46:05 miod Exp $ */ +/* $OpenBSD: setjmp-signal.c,v 1.4 2017/07/27 12:31:09 bluhm Exp $ */ /* * Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain. */ @@ -19,7 +19,7 @@ main() { signal(SIGSEGV, segv_handler); if (setjmp(jb) == 0) { - *((int *)0L) = 0; + *((volatile int *)0L) = 0; return (1); } return (0); |