Skip to content

Commit

Permalink
target/arm: fix TCG leak for fcvt half->double
Browse files Browse the repository at this point in the history
When support for the AHP flag was added we inexplicably only freed the
new temps in one of the two legs. Move those tcg_temp_free to the same
level as the allocation to fix that leak.

Fixes: 486624f
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20200131153439.26027-1-alex.bennee@linaro.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit aeab8e5)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
stsquad authored and mdroth committed Jun 22, 2020
1 parent 4b34c6d commit aacf6bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/arm/translate-a64.c
Expand Up @@ -5778,8 +5778,6 @@ static void handle_fp_fcvt(DisasContext *s, int opcode,
TCGv_i32 tcg_rd = tcg_temp_new_i32();
gen_helper_vfp_fcvt_f16_to_f32(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp);
write_fp_sreg(s, rd, tcg_rd);
tcg_temp_free_ptr(tcg_fpst);
tcg_temp_free_i32(tcg_ahp);
tcg_temp_free_i32(tcg_rd);
} else {
/* Half to double */
Expand All @@ -5789,6 +5787,8 @@ static void handle_fp_fcvt(DisasContext *s, int opcode,
tcg_temp_free_i64(tcg_rd);
}
tcg_temp_free_i32(tcg_rn);
tcg_temp_free_ptr(tcg_fpst);
tcg_temp_free_i32(tcg_ahp);
break;
}
default:
Expand Down

0 comments on commit aacf6bf

Please sign in to comment.