Patchwork resource leak fixes for iwmmxt disassemble

login
register
mail settings
Submitter Lars Munch
Date March 15, 2010, 5:22 p.m.
Message ID <20100315172204.GF8895@firewall>
Download mbox | patch
Permalink /patch/47774/
State New
Headers show

Comments

Lars Munch - March 15, 2010, 5:22 p.m.
This patch fixes few resource leaks in the iwmmxt disassemble.

Signed-off-by: Lars Munch <lars@segv.dk>
---
 target-arm/translate.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Aurelien Jarno - April 8, 2010, 9:58 a.m.
On Mon, Mar 15, 2010 at 06:22:04PM +0100, Lars Munch wrote:
> 
> This patch fixes few resource leaks in the iwmmxt disassemble.

Thanks, applied.

> Signed-off-by: Lars Munch <lars@segv.dk>
> ---
>  target-arm/translate.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index cdfe946..2ab7881 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -1131,6 +1131,7 @@ static inline TCGv iwmmxt_load_creg(int reg)
>  static inline void iwmmxt_store_creg(int reg, TCGv var)
>  {
>      tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg]));
> +    dead_tmp(var);
>  }
>  
>  static inline void gen_op_iwmmxt_movq_wRn_M0(int rn)
> @@ -1415,6 +1416,7 @@ static int disas_iwmmxt_insn(CPUState *env, DisasContext *s, uint32_t insn)
>                  }
>              }
>          }
> +        dead_tmp(addr);
>          return 0;
>      }
>  
> -- 
> 1.7.0
> 
> 
> 
>

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index cdfe946..2ab7881 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -1131,6 +1131,7 @@  static inline TCGv iwmmxt_load_creg(int reg)
 static inline void iwmmxt_store_creg(int reg, TCGv var)
 {
     tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg]));
+    dead_tmp(var);
 }
 
 static inline void gen_op_iwmmxt_movq_wRn_M0(int rn)
@@ -1415,6 +1416,7 @@  static int disas_iwmmxt_insn(CPUState *env, DisasContext *s, uint32_t insn)
                 }
             }
         }
+        dead_tmp(addr);
         return 0;
     }