aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-01-19 17:28:33 +0100
committerAlexander Graf <agraf@suse.de>2014-06-16 13:24:34 +0200
commit3de31797825e94fd67ee7c2e877127acc3d2edbd (patch)
treee3f7bac07a73df0bd39b809d183756bfb1903675
parentc80d1df5083846396ab5120731a76a9d62900fda (diff)
PPC: Fail on leaking temporaries
When QEMU gets compiled with --enable-debug-tcg we can check for temporary leakage. Implement the necessary target code for this and fail emulation when we hit a leakage. This hopefully ensures that we don't get new leaks. Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--target-ppc/translate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 1603995e06..7be776f161 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -11767,6 +11767,7 @@ static inline void gen_intermediate_code_internal(PowerPCCPU *cpu,
max_insns = CF_COUNT_MASK;
gen_tb_start();
+ tcg_clear_temp_count();
/* Set env in case of segfault during code fetch */
while (ctx.exception == POWERPC_EXCP_NONE
&& tcg_ctx.gen_opc_ptr < gen_opc_end) {
@@ -11866,6 +11867,12 @@ static inline void gen_intermediate_code_internal(PowerPCCPU *cpu,
*/
break;
}
+ if (tcg_check_temp_count()) {
+ fprintf(stderr, "Opcode %02x %02x %02x (%08x) leaked temporaries\n",
+ opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode),
+ ctx.opcode);
+ exit(1);
+ }
}
if (tb->cflags & CF_LAST_IO)
gen_io_end();