Module Name:    src
Committed By:   riastradh
Date:           Mon Feb 15 20:35:59 UTC 2016

Modified Files:
        src/sys/arch/amd64/amd64: machdep.c

Log Message:
Use KASSERTs supported by CTASSERTs, not __builtin_unreachable.

pcc has no __builtin_unreachable, and this is clearer anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sys/arch/amd64/amd64/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.214 src/sys/arch/amd64/amd64/machdep.c:1.215
--- src/sys/arch/amd64/amd64/machdep.c:1.214	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/machdep.c	Mon Feb 15 20:35:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.214 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.215 2016/02/15 20:35:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.214 2015/11/22 13:41:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.215 2016/02/15 20:35:59 riastradh Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -2073,9 +2073,11 @@ valid_user_selector(struct lwp *l, uint6
 		if (off > (len - 8))
 			return EINVAL;
 	} else {
-		if (seg != GUDATA_SEL || seg != GUDATA32_SEL)
-			return EINVAL;
-		__builtin_unreachable();
+		CTASSERT(GUDATA_SEL & SEL_LDT);
+		KASSERT(seg != GUDATA_SEL);
+		CTASSERT(GUDATA32_SEL & SEL_LDT);
+		KASSERT(seg != GUDATA32_SEL);
+		return EINVAL;
 	}
 
 	sdp = (struct mem_segment_descriptor *)(dt + off);

Reply via email to