From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 6/8] target/alpha: Fix temp leak in gen_call_pal
Date: Tue, 18 Jul 2017 18:45:20 -1000 [thread overview]
Message-ID: <20170719044522.21114-7-rth@twiddle.net> (raw)
In-Reply-To: <20170719044522.21114-1-rth@twiddle.net>
Tested-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
target/alpha/translate.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 5e37b1a..326af7f 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -1189,7 +1189,6 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode)
#ifndef CONFIG_USER_ONLY
/* Privileged PAL code */
if (palcode < 0x40 && (ctx->tbflags & ENV_FLAG_PS_USER) == 0) {
- TCGv tmp;
switch (palcode) {
case 0x01:
/* CFLUSH */
@@ -1222,10 +1221,12 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode)
ld_flag_byte(ctx->ir[IR_V0], ENV_FLAG_PS_SHIFT);
/* But make sure and store only the 3 IPL bits from the user. */
- tmp = tcg_temp_new();
- tcg_gen_andi_i64(tmp, ctx->ir[IR_A0], PS_INT_MASK);
- st_flag_byte(tmp, ENV_FLAG_PS_SHIFT);
- tcg_temp_free(tmp);
+ {
+ TCGv tmp = tcg_temp_new();
+ tcg_gen_andi_i64(tmp, ctx->ir[IR_A0], PS_INT_MASK);
+ st_flag_byte(tmp, ENV_FLAG_PS_SHIFT);
+ tcg_temp_free(tmp);
+ }
/* Allow interrupts to be recognized right away. */
tcg_gen_movi_i64(cpu_pc, ctx->pc);
@@ -1254,9 +1255,12 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode)
case 0x3E:
/* WTINT */
- tmp = tcg_const_i64(1);
- tcg_gen_st32_i64(tmp, cpu_env, -offsetof(AlphaCPU, env) +
- offsetof(CPUState, halted));
+ {
+ TCGv_i32 tmp = tcg_const_i32(1);
+ tcg_gen_st_i32(tmp, cpu_env, -offsetof(AlphaCPU, env) +
+ offsetof(CPUState, halted));
+ tcg_temp_free_i32(tmp);
+ }
tcg_gen_movi_i64(ctx->ir[IR_V0], 0);
return gen_excp(ctx, EXCP_HALTED, 0);
--
2.9.4
next prev parent reply other threads:[~2017-07-19 4:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 4:45 [Qemu-devel] [PULL 0/8] target/alpha cleanups Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 1/8] target/alpha: Remove amask from tb->flags Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 2/8] target/alpha: Copy tb->flags into DisasContext Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 3/8] target/alpha: Merge several flag bytes into ENV->FLAGS Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 4/8] target/alpha: Fix temp leak in gen_bcond Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 5/8] target/alpha: Fix temp leak in gen_mtpr Richard Henderson
2017-07-19 4:45 ` Richard Henderson [this message]
2017-07-19 4:45 ` [Qemu-devel] [PULL 7/8] target/alpha: Fix temp leak in gen_fbcond Richard Henderson
2017-07-19 4:45 ` [Qemu-devel] [PULL 8/8] target/alpha: Log temp leaks Richard Henderson
2017-07-19 16:57 ` [Qemu-devel] [PULL 0/8] target/alpha cleanups Peter Maydell
2017-07-19 21:52 ` Richard Henderson
2017-07-20 9:06 ` Peter Maydell
2017-07-20 22:44 ` Paolo Bonzini
2017-07-19 18:36 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170719044522.21114-7-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).