Module Name:    src
Committed By:   gson
Date:           Tue Sep 12 14:10:49 UTC 2017

Modified Files:
        src/sys/arch/i386/i386: trap.c

Log Message:
Don't use a const variable as an array size, because it is not a
constant expression and will cause the array to needlessly become a
variable-size one.  Fixes "error: stack protector not protecting local
variables: variable length buffer [-Werror=stack-protector]" when
building i386 with MKDEBUG=YES -V COPTS="-g".


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/arch/i386/i386/trap.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/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.289 src/sys/arch/i386/i386/trap.c:1.290
--- src/sys/arch/i386/i386/trap.c:1.289	Sat Aug 12 07:07:53 2017
+++ src/sys/arch/i386/i386/trap.c	Tue Sep 12 14:10:49 2017
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: trap.c,v 1.289 2017/08/12 07:07:53 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.290 2017/09/12 14:10:49 gson Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.289 2017/08/12 07:07:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.290 2017/09/12 14:10:49 gson Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -421,7 +421,7 @@ kernelfault:
 	{
 		static const char lcall[7] = { 0x9a, 0, 0, 0, 0, 7, 0 };
 		const size_t sz = sizeof(lcall);
-		char tmp[sz];
+		char tmp[sizeof(lcall)];
 
 		/* Check for the osyscall lcall instruction. */
 		if (frame->tf_eip < VM_MAXUSER_ADDRESS - sz &&

Reply via email to