aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/translator.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel/tcg/translator.c')
-rw-r--r--accel/tcg/translator.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 1506755f3c..af8798f98b 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -140,10 +140,12 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
&& qemu_log_in_addr_range(db->pc_first)) {
FILE *logfile = qemu_log_trylock();
- qemu_log("----------------\n");
- ops->disas_log(db, cpu);
- qemu_log("\n");
- qemu_log_unlock(logfile);
+ if (logfile) {
+ fprintf(logfile, "----------------\n");
+ ops->disas_log(db, cpu);
+ fprintf(logfile, "\n");
+ qemu_log_unlock(logfile);
+ }
}
#endif
}