Module Name:    src
Committed By:   kamil
Date:           Tue Oct  1 21:49:50 UTC 2019

Modified Files:
        src/sys/kern: sys_ptrace_common.c

Log Message:
Remove 2 static asserts from the kernel ptrace code

sizeof(pid) and sizeof(lwp) will unlikely ever change and the check can
confuse.

The assert has been moved to ATF t_ptrace_wait.c r.1.132.

Requested by <christos>


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/kern/sys_ptrace_common.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/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.60 src/sys/kern/sys_ptrace_common.c:1.61
--- src/sys/kern/sys_ptrace_common.c:1.60	Tue Oct  1 18:44:22 2019
+++ src/sys/kern/sys_ptrace_common.c	Tue Oct  1 21:49:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.60 2019/10/01 18:44:22 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.61 2019/10/01 21:49:50 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.60 2019/10/01 18:44:22 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.61 2019/10/01 21:49:50 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -704,12 +704,7 @@ ptrace_get_process_state(struct proc *t,
 		si = &t->p_sigctx.ps_info;
 		ps.pe_report_event = si->_reason._ptrace_state._pe_report_event;
 
-		CTASSERT(sizeof(ps.pe_other_pid) ==
-		    sizeof(si->_reason._ptrace_state._option._pe_other_pid));
-		CTASSERT(sizeof(ps.pe_lwp) ==
-		    sizeof(si->_reason._ptrace_state._option._pe_other_pid));
 		CTASSERT(sizeof(ps.pe_other_pid) == sizeof(ps.pe_lwp));
-
 		ps.pe_other_pid =
 			si->_reason._ptrace_state._option._pe_other_pid;
 	}

Reply via email to