|
From: Petar J. <pe...@so...> - 2017-10-17 15:31:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2cf115e6570675a3af3fba9bbbb6d65826b7f512 commit 2cf115e6570675a3af3fba9bbbb6d65826b7f512 Author: Petar Jovanovic <mip...@gm...> Date: Tue Oct 17 15:31:06 2017 +0200 mips: fix handling of Iex_ITE While handling Iex_ITE, do not use the same virtual register for the input and output. Issue discovered while testing Valgrind on Android. Patch by Tamara Vlahovic. Diff: --- VEX/priv/host_mips_isel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VEX/priv/host_mips_isel.c b/VEX/priv/host_mips_isel.c index 711af61..3f08e55 100644 --- a/VEX/priv/host_mips_isel.c +++ b/VEX/priv/host_mips_isel.c @@ -1784,13 +1784,15 @@ static HReg iselWordExpr_R_wrk(ISelEnv * env, IRExpr * e) if ((ty == Ity_I8 || ty == Ity_I16 || ty == Ity_I32 || ((ty == Ity_I64))) && typeOfIRExpr(env->type_env, e->Iex.ITE.cond) == Ity_I1) { - HReg r_dst = iselWordExpr_R(env, e->Iex.ITE.iffalse); + HReg r0 = iselWordExpr_R(env, e->Iex.ITE.iffalse); HReg r1 = iselWordExpr_R(env, e->Iex.ITE.iftrue); HReg r_cond = iselWordExpr_R(env, e->Iex.ITE.cond); + HReg r_dst = newVRegI(env); /* * r_dst = r0 * movn r_dst, r1, r_cond */ + addInstr(env, mk_iMOVds_RR(r_dst, r0)); addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, r_dst, r1, r_cond)); return r_dst; } |