aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-16 12:39:38 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-16 12:39:38 +0000
commit4f8eb8daebd72bdc214c63a3b2577f95bbadb27d (patch)
tree41a90df3654e448cd50db889c503404ca74d86b7 /vl.c
parentbd464c2eef04b322a34517cb9886b12bbc045cd1 (diff)
Work around a crash when timer signal occurs before main loop, original patch by 武田 俊也.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3820 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/vl.c b/vl.c
index a4592f7bd0..2ed3254345 100644
--- a/vl.c
+++ b/vl.c
@@ -1186,13 +1186,15 @@ static void host_alarm_handler(int host_signum)
#endif
CPUState *env = next_cpu;
- /* stop the currently executing cpu because a timer occured */
- cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+ if (env) {
+ /* stop the currently executing cpu because a timer occured */
+ cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
- if (env->kqemu_enabled) {
- kqemu_cpu_interrupt(env);
- }
+ if (env->kqemu_enabled) {
+ kqemu_cpu_interrupt(env);
+ }
#endif
+ }
event_pending = 1;
}
}