diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-07-27 12:31:10 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-07-27 12:31:10 +0000 |
commit | 1b98b6865ded85a775fbf23087c02195f5d130c7 (patch) | |
tree | 367c1026a7b780255b5023b34a56b7de7c015db3 /regress | |
parent | f4a168857566039da52ea9d330dd93c27afcf656 (diff) |
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')
-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); |