diff options
author | Fabien Chouteau <chouteau@adacore.com> | 2012-05-14 23:39:09 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-06-24 01:04:44 +0200 |
commit | c8f803e77a39584af30082b7ba11e69a9f046224 (patch) | |
tree | 50ef2e7275990d71b14b36b8cd64cba533a01b96 /qemu-log.h | |
parent | cba2026a410328216f26db276a6ecf0e55a06e17 (diff) | |
download | qemu-c8f803e77a39584af30082b7ba11e69a9f046224.zip qemu-c8f803e77a39584af30082b7ba11e69a9f046224.tar.gz qemu-c8f803e77a39584af30082b7ba11e69a9f046224.tar.bz2 |
Avoid segfault in cpu_dump_state
Do not call cpu_dump_state if logfile is NULL.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
[agraf: adjust to inline functions]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'qemu-log.h')
-rw-r--r-- | qemu-log.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |