Skip to content

Commit

Permalink
Avoid segfault in cpu_dump_state
Browse files Browse the repository at this point in the history
Do not call cpu_dump_state if logfile is NULL.

Signed-off-by: Fabien Chouteau <[email protected]>
[agraf: adjust to inline functions]
Signed-off-by: Alexander Graf <[email protected]>
  • Loading branch information
Fabien-Chouteau authored and agraf committed Jun 23, 2012
1 parent cba2026 commit c8f803e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qemu-log.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
/* cpu_dump_state() logging functions: */
static inline void log_cpu_state(CPUArchState *env1, int flags)
{
cpu_dump_state(env1, qemu_logfile, fprintf, flags);
if (qemu_log_enabled()) {
cpu_dump_state(env1, qemu_logfile, fprintf, flags);
}
}

static inline void log_cpu_state_mask(int mask, CPUArchState *env1, int flags)
Expand Down

0 comments on commit c8f803e

Please sign in to comment.