aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-02-09 22:54:22 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-02-09 23:29:44 +0100
commit307331a42a39b46487f8f4356eaa943101f6af4e (patch)
tree29c9d32aaf3118ec1c7e4aed8dce5ae74f951887
parenttarget-mips: don't call cpu_loop_exit() from helper.c (diff)
downloadqemu-kvm-307331a42a39b46487f8f4356eaa943101f6af4e.tar.gz
qemu-kvm-307331a42a39b46487f8f4356eaa943101f6af4e.tar.bz2
qemu-kvm-307331a42a39b46487f8f4356eaa943101f6af4e.zip
tcg/mips: fix crash in tcg_out_qemu_ld()
The address register is overriden when it corresponds to v0 and the fast path is taken, which leads to a crash. Fix that by using the a0 register instead. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit cca1af8c4d2ef6449fd61494ba2cb087b838011c)
-rw-r--r--tcg/mips/tcg-target.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
index 8fcb5c99c..807b8fdfa 100644
--- a/tcg/mips/tcg-target.c
+++ b/tcg/mips/tcg-target.c
@@ -731,9 +731,9 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
/* label1: fast path */
reloc_pc16(label1_ptr, (tcg_target_long) s->code_ptr);
- tcg_out_opc_imm(s, OPC_LW, TCG_REG_V0, TCG_REG_A0,
+ tcg_out_opc_imm(s, OPC_LW, TCG_REG_A0, TCG_REG_A0,
offsetof(CPUState, tlb_table[mem_index][0].addend) + addr_meml);
- tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_V0, TCG_REG_V0, addr_regl);
+ tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_V0, TCG_REG_A0, addr_regl);
addr_reg1 = TCG_REG_V0;
#endif