Commit c19dbb9426a34a8e8cfdc5c285e8562ff3fe4f7a

Authored by ths
1 parent 4cae1d16

Fix crash in set registers in PPC gdb-stub, by Jason Wessel.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3079 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 4 deletions
target-ppc/helper.c
@@ -1493,10 +1493,12 @@ void do_store_msr (CPUPPCState *env, target_ulong value) @@ -1493,10 +1493,12 @@ void do_store_msr (CPUPPCState *env, target_ulong value)
1493 break; 1493 break;
1494 } 1494 }
1495 if (enter_pm) { 1495 if (enter_pm) {
1496 - /* power save: exit cpu loop */  
1497 - env->halted = 1;  
1498 - env->exception_index = EXCP_HLT;  
1499 - cpu_loop_exit(); 1496 + if (likely(!env->halted)) {
  1497 + /* power save: exit cpu loop */
  1498 + env->halted = 1;
  1499 + env->exception_index = EXCP_HLT;
  1500 + cpu_loop_exit();
  1501 + }
1500 } 1502 }
1501 } 1503 }
1502 1504