qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH 24/72] Avoid segfault in cpu_dump_state


From: Alexander Graf
Subject: [Qemu-ppc] [PATCH 24/72] Avoid segfault in cpu_dump_state
Date: Sun, 24 Jun 2012 01:06:48 +0200

From: Fabien Chouteau <address@hidden>

Do not call cpu_dump_state if logfile is NULL.

Signed-off-by: Fabien Chouteau <address@hidden>
[agraf: adjust to inline functions]
Signed-off-by: Alexander Graf <address@hidden>
---
 qemu-log.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/qemu-log.h b/qemu-log.h
index 40f8b7b..2ed19d1 100644
--- a/qemu-log.h
+++ b/qemu-log.h
@@ -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)
-- 
1.6.0.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]