[Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak

Philippe Mathieu-Daudé posted 6 patches 6 years, 8 months ago
[Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
The function gen_get_ccr() returns a tcg_temp created with
tcg_temp_new(). Free it with tcg_temp_free().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Laurent/Richard, feel free to squash this with the next patch, but
IMHO having it split as a previous step makes the next patch easier
to review.
---
 target/m68k/translate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 55766fd7ef..ea95d55a11 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -2224,6 +2224,7 @@ static TCGv gen_get_sr(DisasContext *s)
     sr = tcg_temp_new();
     tcg_gen_andi_i32(sr, QREG_SR, 0xffe0);
     tcg_gen_or_i32(sr, sr, ccr);
+    tcg_temp_free(ccr);
     return sr;
 }
 
-- 
2.19.1


Re: [Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak
Posted by Richard Henderson 6 years, 8 months ago
On 3/9/19 4:34 PM, Philippe Mathieu-Daudé wrote:
> The function gen_get_ccr() returns a tcg_temp created with
> tcg_temp_new(). Free it with tcg_temp_free().
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Laurent/Richard, feel free to squash this with the next patch, but
> IMHO having it split as a previous step makes the next patch easier
> to review.
> ---
>  target/m68k/translate.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~