diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2010-01-15 09:42:08 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-19 16:31:03 -0600 |
commit | 34dec6a5608e3a878966fb0c0369a0dbbf6e3d9b (patch) | |
tree | 6f0c005b947b9dcdffb3e923565557c312e46dde /cpu-exec.c | |
parent | 1c3569fe4e4e3783b7813f450fa699d3f552e44f (diff) | |
download | hqemu-34dec6a5608e3a878966fb0c0369a0dbbf6e3d9b.zip hqemu-34dec6a5608e3a878966fb0c0369a0dbbf6e3d9b.tar.gz |
add assertions about env->current_tb
By virtue of the previous patch env->current_tb will always be NULL at
the top of cpu_exec's outermost for loop, and at the end of the innermost
while loop.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r-- | cpu-exec.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -22,6 +22,8 @@ #include "tcg.h" #include "kvm.h" +#include <assert.h> + #if !defined(CONFIG_SOFTMMU) #undef EAX #undef ECX @@ -260,7 +262,7 @@ int cpu_exec(CPUState *env1) env = cpu_single_env; #define env cpu_single_env #endif - env->current_tb = NULL; + assert (env->current_tb == NULL); /* if an exception is pending, we execute it here */ if (env->exception_index >= 0) { if (env->exception_index >= EXCP_INTERRUPT) { @@ -595,6 +597,7 @@ int cpu_exec(CPUState *env1) } spin_unlock(&tb_lock); env->current_tb = tb; + assert (env->current_tb); /* cpu_interrupt might be called while translating the TB, but before it is linked into a potentially @@ -640,6 +643,7 @@ int cpu_exec(CPUState *env1) cpu_loop_exit(); } } + assert (env->current_tb == NULL); } /* reset soft MMU for next block (it can currently only be set by a memory fault) */ |