Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/misc Try to make load_invalid_value_bool port...



details:   https://anonhg.NetBSD.org/src/rev/2564f6438201
branches:  trunk
changeset: 449052:2564f6438201
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Feb 20 09:50:09 2019 +0000

description:
Try to make load_invalid_value_bool portable to Big-Endian

PR bin/53968 by Michael van Elst

diffstat:

 tests/lib/libc/misc/t_ubsan.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 431ecdaaafac -r 2564f6438201 tests/lib/libc/misc/t_ubsan.c
--- a/tests/lib/libc/misc/t_ubsan.c     Wed Feb 20 09:25:11 2019 +0000
+++ b/tests/lib/libc/misc/t_ubsan.c     Wed Feb 20 09:50:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ubsan.c,v 1.3 2019/02/04 03:10:33 mrg Exp $  */
+/*     $NetBSD: t_ubsan.c,v 1.4 2019/02/20 09:50:09 kamil Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2018\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ubsan.c,v 1.3 2019/02/04 03:10:33 mrg Exp $");
+__RCSID("$NetBSD: t_ubsan.c,v 1.4 2019/02/20 09:50:09 kamil Exp $");
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -295,7 +295,7 @@
 static void
 test_load_invalid_value_bool(void)
 {
-       volatile int a = atoi("10");
+       volatile int a = INT_MAX - atoi("10");
        volatile bool b = *(REINTERPRET_CAST(volatile bool *, &a));
 
        raise(b ? SIGSEGV : SIGBUS);



Home | Main Index | Thread Index | Old Index