From: Petar Jovanovic Date: Tue, 17 Oct 2017 13:40:47 +0000 (+0200) Subject: mips: simplify handling of Iop_Max32U X-Git-Tag: VALGRIND_3_14_0~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd1d7eb00c2a21fde127fadcd65ea91c535ac497;p=thirdparty%2Fvalgrind.git mips: simplify handling of Iop_Max32U Use MIPSRH_Reg to get MIPSRH for Iop_Max32U. Without it, under specific circumstances, the code may explode and exceed Valgrind instruction buffer due to multiple calls to iselWordExpr_R through iselWordExpr_RH. Issue discovered while testing Valgrind on Android. Patch by Tamara Vlahovic. --- diff --git a/VEX/priv/host_mips_isel.c b/VEX/priv/host_mips_isel.c index 3f08e55a57..3d51919fd6 100644 --- a/VEX/priv/host_mips_isel.c +++ b/VEX/priv/host_mips_isel.c @@ -1048,8 +1048,7 @@ static HReg iselWordExpr_R_wrk(ISelEnv * env, IRExpr * e) HReg r_dst = newVRegI(env); HReg argL = iselWordExpr_R(env, e->Iex.Binop.arg1); HReg argR = iselWordExpr_R(env, e->Iex.Binop.arg2); - MIPSRH *argRH = iselWordExpr_RH(env, False /*signed */ , - e->Iex.Binop.arg2); + MIPSRH *argRH = MIPSRH_Reg(argR); /* max (v0, s0) ------------ slt v1, v0, s0