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 Unify the style of t_ubsan tests



details:   https://anonhg.NetBSD.org/src/rev/a2dee01f86a9
branches:  trunk
changeset: 449066:a2dee01f86a9
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Feb 20 11:40:41 2019 +0000

description:
Unify the style of t_ubsan tests

Apply similar change for load_invalid_value_bool in
test_load_invalid_value_enum.

Follow up of 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 4a3b5016c0cc -r a2dee01f86a9 tests/lib/libc/misc/t_ubsan.c
--- a/tests/lib/libc/misc/t_ubsan.c     Wed Feb 20 10:09:45 2019 +0000
+++ b/tests/lib/libc/misc/t_ubsan.c     Wed Feb 20 11:40:41 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ubsan.c,v 1.4 2019/02/20 09:50:09 kamil Exp $        */
+/*     $NetBSD: t_ubsan.c,v 1.5 2019/02/20 11:40:41 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.4 2019/02/20 09:50:09 kamil Exp $");
+__RCSID("$NetBSD: t_ubsan.c,v 1.5 2019/02/20 11:40:41 kamil Exp $");
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -318,7 +318,7 @@
 test_load_invalid_value_enum(void)
 {
        enum e { e1, e2, e3, e4 };
-       volatile int a = atoi("10");
+       volatile int a = INT_MAX - atoi("10");
        volatile enum e E = *(REINTERPRET_CAST(volatile enum e*, &a));
 
        raise((E == e1) ? SIGSEGV : SIGBUS);



Home | Main Index | Thread Index | Old Index