aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-26 20:12:28 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-26 20:12:28 +0000
commit6f5a9f7e56ab8dfeacca9ac779c0661261642873 (patch)
tree629e55857ec303e52c2032a8d02f3d6c4e03e524 /exec.c
parent4a38940da0c0376ed29252757f3b2fa26944cd47 (diff)
fixed async signal support for tb_phys_invalidate()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1670 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index b9009a1e97..70ad14dc1f 100644
--- a/exec.c
+++ b/exec.c
@@ -672,12 +672,19 @@ void tb_invalidate_phys_page_range(target_ulong start, target_ulong end,
#endif
}
#endif /* TARGET_HAS_PRECISE_SMC */
- saved_tb = env->current_tb;
- env->current_tb = NULL;
+ /* we need to do that to handle the case where a signal
+ occurs while doing tb_phys_invalidate() */
+ saved_tb = NULL;
+ if (env) {
+ saved_tb = env->current_tb;
+ env->current_tb = NULL;
+ }
tb_phys_invalidate(tb, -1);
- env->current_tb = saved_tb;
- if (env->interrupt_request && env->current_tb)
- cpu_interrupt(env, env->interrupt_request);
+ if (env) {
+ env->current_tb = saved_tb;
+ if (env->interrupt_request && env->current_tb)
+ cpu_interrupt(env, env->interrupt_request);
+ }
}
tb = tb_next;
}