Skip to contentSkip to conversation

cpu-exec: Move down some declarations in cpu_exec()

PATCH In review Sergey Fedorov 2 participants 2 messages Jul 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu-exec: Move down some declarations in cpu_exec()

From: Sergey Fedorov <[email protected]>

This will fix a compiler warning with -Wclobbered:

http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg03347.html

---
 cpu-exec.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
cpu-exec.c +3 -4
index b840e1d2dd41..5d9710a1eaf2 100644
@@ -608,17 +608,16 @@ int cpu_exec(CPUState *cpu)
     init_delay_params(&sc, cpu);
 
     for(;;) {
-        TranslationBlock *tb, *last_tb;
-        int tb_exit = 0;
-
         /* prepare setjmp context for exception handling */
         if (sigsetjmp(cpu->jmp_env, 0) == 0) {
+            TranslationBlock *tb, *last_tb = NULL;
+            int tb_exit = 0;
+
             /* if an exception is pending, we execute it here */
             if (cpu_handle_exception(cpu, &ret)) {
                 break;
             }
 
-            last_tb = NULL; /* forget the last executed TB after exception */
             cpu->tb_flushed = false; /* reset before first TB lookup */
             for(;;) {
                 cpu_handle_interrupt(cpu, &last_tb);
Signature · 1 line
2.9.1
Reviewed-by on v1 1/1
#1 lore raw

Am 15.07.2016 um 21:31 schrieb Sergey Fedorov:

Quoted 29 lines

From: Sergey Fedorov <[email protected]>

This will fix a compiler warning with -Wclobbered:

http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg03347.html

---
 cpu-exec.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
cpu-exec.c +2 -3
index b840e1d2dd41..5d9710a1eaf2 100644
@@ -608,17 +608,16 @@ int cpu_exec(CPUState *cpu)
     init_delay_params(&sc, cpu);
 
     for(;;) {
-        TranslationBlock *tb, *last_tb;
-        int tb_exit = 0;
-
         /* prepare setjmp context for exception handling */
         if (sigsetjmp(cpu->jmp_env, 0) == 0) {
+            TranslationBlock *tb, *last_tb = NULL;
+            int tb_exit = 0;

cpu-exec.c int cpu_exec(CPUState *cpu) · line 623

Quoted 10 lines
cpu-exec.c +1 -1
+
             /* if an exception is pending, we execute it here */
             if (cpu_handle_exception(cpu, &ret)) {
                 break;
             }
 
-            last_tb = NULL; /* forget the last executed TB after exception */
             cpu->tb_flushed = false; /* reset before first TB lookup */
             for(;;) {
                 cpu_handle_interrupt(cpu, &last_tb);

Thanks.