diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-23 16:53:59 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-23 16:53:59 +0000 |
commit | 493ae1f01cad47c3b4143059e986ba76e4d5202e (patch) | |
tree | 09e69e600d3e3d706b7f0ace8e59f122c2f30c96 /exec.c | |
parent | 497ad68cd499bf2b6cc3bfde49fdb5aa05934ec4 (diff) |
Fix va_list reuse in cpu_abort.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3722 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1281,8 +1281,10 @@ int cpu_str_to_log_mask(const char *str) void cpu_abort(CPUState *env, const char *fmt, ...) { va_list ap; + va_list ap2; va_start(ap, fmt); + va_copy(ap2, ap); fprintf(stderr, "qemu: fatal: "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); @@ -1298,7 +1300,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...) #endif if (logfile) { fprintf(logfile, "qemu: fatal: "); - vfprintf(logfile, fmt, ap); + vfprintf(logfile, fmt, ap2); fprintf(logfile, "\n"); #ifdef TARGET_I386 cpu_dump_state(env, logfile, fprintf, X86_DUMP_FPU | X86_DUMP_CCOP); @@ -1308,6 +1310,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...) fflush(logfile); fclose(logfile); } + va_end(ap2); va_end(ap); abort(); } |