提交 493ae1f0 编写于 作者: P pbrook

Fix va_list reuse in cpu_abort.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3722 c046a42c-6fe2-441c-8c8c-71466251a162
上级 497ad68c
...@@ -1281,8 +1281,10 @@ int cpu_str_to_log_mask(const char *str) ...@@ -1281,8 +1281,10 @@ int cpu_str_to_log_mask(const char *str)
void cpu_abort(CPUState *env, const char *fmt, ...) void cpu_abort(CPUState *env, const char *fmt, ...)
{ {
va_list ap; va_list ap;
va_list ap2;
va_start(ap, fmt); va_start(ap, fmt);
va_copy(ap2, ap);
fprintf(stderr, "qemu: fatal: "); fprintf(stderr, "qemu: fatal: ");
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
...@@ -1298,7 +1300,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...) ...@@ -1298,7 +1300,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
#endif #endif
if (logfile) { if (logfile) {
fprintf(logfile, "qemu: fatal: "); fprintf(logfile, "qemu: fatal: ");
vfprintf(logfile, fmt, ap); vfprintf(logfile, fmt, ap2);
fprintf(logfile, "\n"); fprintf(logfile, "\n");
#ifdef TARGET_I386 #ifdef TARGET_I386
cpu_dump_state(env, logfile, fprintf, X86_DUMP_FPU | X86_DUMP_CCOP); cpu_dump_state(env, logfile, fprintf, X86_DUMP_FPU | X86_DUMP_CCOP);
...@@ -1308,6 +1310,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...) ...@@ -1308,6 +1310,7 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
fflush(logfile); fflush(logfile);
fclose(logfile); fclose(logfile);
} }
va_end(ap2);
va_end(ap); va_end(ap);
abort(); abort();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册