aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2017-07-13 13:22:08 -1000
committerRichard Henderson <rth@twiddle.net>2017-07-18 18:41:55 -1000
commit22d716c28e95e4640e2cd80553eb3f662db3fd50 (patch)
treef1305b61b809578ece2e327ec4695d6bffc856aa /target
parentbcd2625da578d281c710033995d0fb6ea3dff1d4 (diff)
target/alpha: Fix temp leak in gen_bcond
Tested-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target')
-rw-r--r--target/alpha/translate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 140d6f366e..d684a7b613 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. */