From ea311a995999f82f1647f4fd4967d4e8b3fbd806 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20Benn=C3=A9e?= Date: Wed, 6 Dec 2017 09:30:50 +0000 Subject: [PATCH] target/sh4: fix TCG leak during gusa sequence MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes bug #1735384 while running java under qemu-sh4. When debug was enabled it showed a problem with TCG temps. Once fixed I was able to run java -version normally. Cc: qemu-stable@nongnu.org Reported-by: John Paul Adrian Glaubitz Suggested-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20171206093050.25308-1-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno Signed-off-by: Aurelien Jarno (cherry picked from commit 6d56fc6cc372284a4571f09b361a9ccd99318103) Signed-off-by: Michael Roth --- target/sh4/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 703020fe87f..b4b5c822d08 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -2189,7 +2189,7 @@ static int decode_gusa(DisasContext *ctx, CPUSH4State *env, int *pmax_insns) } /* If op_src is not a valid register, then op_arg was a constant. */ - if (op_src < 0) { + if (op_src < 0 && !TCGV_IS_UNUSED(op_arg)) { tcg_temp_free_i32(op_arg); } -- 2.39.5