[PATCH] target/mips: Fix TCG temporary leaks in gen_pool32a5_nanomips_insn()

Philippe Mathieu-Daudé posted 1 patch 2 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/next-importer-push tags/patchew/20210530094538.1275329-1-f4bug@amsat.org
Maintainers: Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
target/mips/tcg/translate.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] target/mips: Fix TCG temporary leaks in gen_pool32a5_nanomips_insn()
Posted by Philippe Mathieu-Daudé 2 years, 10 months ago
Fix a pair of TCG temporary leak when translating nanoMIPS SHILO opcode.

Fixes: 3285a3e4445 ("target/mips: Add emulation of DSP ASE for nanoMIPS")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/tcg/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index c03a8ae1fed..84c71a75c76 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -20177,16 +20177,18 @@ static void gen_pool32a5_nanomips_insn(DisasContext *ctx, int opc,
         {
             TCGv tv0 = tcg_temp_new();
             TCGv tv1 = tcg_temp_new();
             int16_t imm = extract32(ctx->opcode, 16, 7);
 
             tcg_gen_movi_tl(tv0, rd >> 3);
             tcg_gen_movi_tl(tv1, imm);
             gen_helper_shilo(tv0, tv1, cpu_env);
+            tcg_temp_free(tv1);
+            tcg_temp_free(tv0);
         }
         break;
     case NM_MULEQ_S_W_PHL:
         check_dsp(ctx);
         gen_helper_muleq_s_w_phl(v1_t, v1_t, v2_t, cpu_env);
         gen_store_gpr(v1_t, ret);
         break;
     case NM_MULEQ_S_W_PHR:
-- 
2.26.3


Re: [PATCH] target/mips: Fix TCG temporary leaks in gen_pool32a5_nanomips_insn()
Posted by Richard Henderson 2 years, 10 months ago
On 5/30/21 2:45 AM, Philippe Mathieu-Daudé wrote:
> Fix a pair of TCG temporary leak when translating nanoMIPS SHILO opcode.
> 
> Fixes: 3285a3e4445 ("target/mips: Add emulation of DSP ASE for nanoMIPS")
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   target/mips/tcg/translate.c | 2 ++
>   1 file changed, 2 insertions(+)

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

r~

Re: [PATCH] target/mips: Fix TCG temporary leaks in gen_pool32a5_nanomips_insn()
Posted by Philippe Mathieu-Daudé 2 years, 10 months ago
On 5/30/21 11:45 AM, Philippe Mathieu-Daudé wrote:
> Fix a pair of TCG temporary leak when translating nanoMIPS SHILO opcode.
> 
> Fixes: 3285a3e4445 ("target/mips: Add emulation of DSP ASE for nanoMIPS")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/mips/tcg/translate.c | 2 ++
>  1 file changed, 2 insertions(+)

Thanks, applied to mips-next.