]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips: simplify handling of Iop_Max32U
authorPetar Jovanovic <mips32r2@gmail.com>
Tue, 17 Oct 2017 13:40:47 +0000 (15:40 +0200)
committerPetar Jovanovic <mips32r2@gmail.com>
Tue, 17 Oct 2017 13:40:47 +0000 (15:40 +0200)
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.

VEX/priv/host_mips_isel.c

index 3f08e55a5701a76c405c941b0e80be62392b6b0c..3d51919fd626710d275a8f0b8fd4507ddb5db571 100644 (file)
@@ -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