Module Name:    src
Committed By:   mrg
Date:           Mon Feb  4 09:54:47 UTC 2019

Modified Files:
        src/sys/kern: kern_veriexec.c
        src/sys/lib/libunwind: libunwind.cxx

Log Message:
use __builtin_unreachable() after calls that panic or switch context


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.10 -r1.11 src/sys/lib/libunwind/libunwind.cxx

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

Modified files:

Index: src/sys/kern/kern_veriexec.c
diff -u src/sys/kern/kern_veriexec.c:1.18 src/sys/kern/kern_veriexec.c:1.19
--- src/sys/kern/kern_veriexec.c:1.18	Tue Nov  7 18:35:57 2017
+++ src/sys/kern/kern_veriexec.c	Mon Feb  4 09:54:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_veriexec.c,v 1.18 2017/11/07 18:35:57 christos Exp $	*/
+/*	$NetBSD: kern_veriexec.c,v 1.19 2019/02/04 09:54:47 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 Elad Efrat <[email protected]>
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.18 2017/11/07 18:35:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.19 2019/02/04 09:54:47 mrg Exp $");
 
 #include "opt_veriexec.h"
 
@@ -649,6 +649,7 @@ veriexec_file_verify(struct lwp *l, stru
 		veriexec_file_report(vfe, "Not-evaluated status "
 		    "post evaluation; inconsistency detected.", name,
 		    NULL, REPORT_ALWAYS|REPORT_PANIC);
+		__builtin_unreachable();
 		/* NOTREACHED */
 
 	case FINGERPRINT_VALID:

Index: src/sys/lib/libunwind/libunwind.cxx
diff -u src/sys/lib/libunwind/libunwind.cxx:1.10 src/sys/lib/libunwind/libunwind.cxx:1.11
--- src/sys/lib/libunwind/libunwind.cxx:1.10	Tue Jul 17 19:01:16 2018
+++ src/sys/lib/libunwind/libunwind.cxx	Mon Feb  4 09:54:47 2019
@@ -119,6 +119,7 @@ static _Unwind_Reason_Code unwind_phase2
     case _URC_INSTALL_CONTEXT:
       // Transfer control to landing pad.
       cursor.jumpto();
+      __builtin_unreachable();
     default:
       // Bad personality routine.
       return _URC_FATAL_PHASE2_ERROR;
@@ -181,6 +182,7 @@ static _Unwind_Reason_Code unwind_phase2
     case _URC_INSTALL_CONTEXT:
       // Transfer control to landing pad.
       cursor.jumpto();
+      __builtin_unreachable();
     default:
       // Bad personality routine.
       return _URC_FATAL_PHASE2_ERROR;

Reply via email to