Module Name: src
Committed By: kamil
Date: Wed Feb 20 09:50:09 UTC 2019
Modified Files:
src/tests/lib/libc/misc: t_ubsan.c
Log Message:
Try to make load_invalid_value_bool portable to Big-Endian
PR bin/53968 by Michael van Elst
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/misc/t_ubsan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/misc/t_ubsan.c
diff -u src/tests/lib/libc/misc/t_ubsan.c:1.3 src/tests/lib/libc/misc/t_ubsan.c:1.4
--- src/tests/lib/libc/misc/t_ubsan.c:1.3 Mon Feb 4 03:10:33 2019
+++ src/tests/lib/libc/misc/t_ubsan.c Wed Feb 20 09:50:09 2019
@@ -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, t
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);