From: Richard Henderson Date: Thu, 13 Jul 2017 23:22:08 +0000 (-1000) Subject: target/alpha: Fix temp leak in gen_bcond X-Git-Tag: v2.10.0-rc0~33^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22d716c28e95e4640e2cd80553eb3f662db3fd50;p=thirdparty%2Fqemu.git target/alpha: Fix temp leak in gen_bcond Tested-by: Emilio G. Cota Signed-off-by: Richard Henderson --- diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 140d6f366e9..d684a7b6130 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -565,16 +565,16 @@ static ExitStatus gen_bcond_internal(DisasContext *ctx, TCGCond cond, static ExitStatus gen_bcond(DisasContext *ctx, TCGCond cond, int ra, int32_t disp, int mask) { - TCGv cmp_tmp; - if (mask) { - cmp_tmp = tcg_temp_new(); - tcg_gen_andi_i64(cmp_tmp, load_gpr(ctx, ra), 1); - } else { - cmp_tmp = load_gpr(ctx, ra); - } + TCGv tmp = tcg_temp_new(); + ExitStatus ret; - return gen_bcond_internal(ctx, cond, cmp_tmp, disp); + tcg_gen_andi_i64(tmp, load_gpr(ctx, ra), 1); + ret = gen_bcond_internal(ctx, cond, tmp, disp); + tcg_temp_free(tmp); + return ret; + } + return gen_bcond_internal(ctx, cond, load_gpr(ctx, ra), disp); } /* Fold -0.0 for comparison with COND. */