From d62085e5c5eb47cc2442899b125c799cb90e6d7b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 6 Apr 2012 21:17:05 +0200 Subject: Do not take address of va_list variable This breaks on x86_64, where it is an array and thus gets bogus results. * ddb/db_output.c (db_printf, kdbprintf): Pass copy of va_list variable instead of its address. * kern/debug.c (panic, log): Likewise. * kern/printf.c (vprintf, iprintf, sprintf, vsnprintf): Likewise. (_doprnt): Take va_list instead of va_list *, fix usage and comment accordingly. * kern/printf.h (_doprnt): Take va_list instead of va_list *. --- kern/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kern/debug.c') diff --git a/kern/debug.c b/kern/debug.c index 65c43fba..09c8ff48 100644 --- a/kern/debug.c +++ b/kern/debug.c @@ -168,7 +168,7 @@ panic(const char *s, ...) #endif printf(": "); va_start(listp, s); - _doprnt(s, &listp, do_cnputc, 0, 0); + _doprnt(s, listp, do_cnputc, 0, 0); va_end(listp); printf("\n"); @@ -203,7 +203,7 @@ log(int level, const char *fmt, ...) level++; #endif va_start(listp, fmt); - _doprnt(fmt, &listp, do_cnputc, 0, 0); + _doprnt(fmt, listp, do_cnputc, 0, 0); va_end(listp); } -- cgit v1.2.3