summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2019-02-20 09:50:09 +0000
committerkamil <kamil@NetBSD.org>2019-02-20 09:50:09 +0000
commitfd251db7269ee8cf1aaa605f3efcbb23084cf779 (patch)
treefe8c3514948121dbe2c3b574f95b80683e46acd5
parent2db31aa8e7f85abe9d3b767a424a0de45ab6233c (diff)
Try to make load_invalid_value_bool portable to Big-Endian
PR bin/53968 by Michael van Elst
-rw-r--r--tests/lib/libc/misc/t_ubsan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/lib/libc/misc/t_ubsan.c b/tests/lib/libc/misc/t_ubsan.c
index 62e617bd3f6..d2eb23b62e0 100644
--- a/tests/lib/libc/misc/t_ubsan.c
+++ b/tests/lib/libc/misc/t_ubsan.c
@@ -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 @@ UBSAN_TC_HEAD(load_invalid_value_bool, tc)
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);