From: Alex Bennée Date: Fri, 31 Jan 2020 15:34:39 +0000 (+0000) Subject: target/arm: fix TCG leak for fcvt half->double X-Git-Tag: v4.2.1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aacf6bfb7edc5aaab2bc2fddfd6fd481cb877bc6;p=thirdparty%2Fqemu.git target/arm: fix TCG leak for fcvt half->double 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: 486624fcd3eac Signed-off-by: Alex Bennée Message-id: 20200131153439.26027-1-alex.bennee@linaro.org Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit aeab8e5eb220cc5ff84b0b68b9afccc611bf0fcd) Signed-off-by: Michael Roth --- diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index d4bebbe6295..045da926671 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -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 */ @@ -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: