]> git.proxmox.com Git - qemu.git/commitdiff
clean up env->current_tb
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 Jan 2010 08:42:07 +0000 (09:42 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 19 Jan 2010 22:31:03 +0000 (16:31 -0600)
There are three paths from the innermost while loop of cpu_exec
to the top of the outermost for loop.  Two do not reset
env->current_tb.  Fix this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cpu-exec.c

index 2f119a94194d8073301b3a9501e69ba2f091f7c8..2b3e6989e3cd49a2ceceaec6b24d5894c7e969fe 100644 (file)
@@ -56,6 +56,7 @@ int qemu_cpu_has_work(CPUState *env)
 
 void cpu_loop_exit(void)
 {
+    env->current_tb = NULL;
     longjmp(env->jmp_env, 1);
 }
 
@@ -107,6 +108,7 @@ static void cpu_exec_nocache(int max_cycles, TranslationBlock *orig_tb)
     env->current_tb = tb;
     /* execute the generated code */
     next_tb = tcg_qemu_tb_exec(tb->tc_ptr);
+    env->current_tb = NULL;
 
     if ((next_tb & 3) == 2) {
         /* Restore PC.  This may happen if async event occurs before