]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 384930 - Valgrind fails to compute correctly some code using the GMP library.
authorJulian Seward <jseward@acm.org>
Fri, 16 Feb 2018 07:02:00 +0000 (08:02 +0100)
committerJulian Seward <jseward@acm.org>
Fri, 16 Feb 2018 07:02:00 +0000 (08:02 +0100)
For the ADCX and ADOX instructions, the VEX front end failed to create a PUT to
the result register in the case where one of the operands is from memory, for
example in

   adoxq 48(%rdi),%r12

where %r12 is never written.  This commit fixes it.

VEX/priv/guest_amd64_toIR.c

index d00f45331c32a9c234c324f00c593eb201552277..f4620306ca09d276b4f5c1a6e6ce3b8ff591e292 100644 (file)
@@ -3080,12 +3080,12 @@ ULong dis_op2_E_G ( const VexAbiInfo* vbi,
          putIRegG(size, pfx, rm, mkexpr(dst1));
       } else
       if (op8 == Iop_Add8 && flag == WithFlagCarryX) {
-         /* normal store */
          helper_ADCX_ADOX( True/*isADCX*/, size, dst1, dst0, src );
+         putIRegG(size, pfx, rm, mkexpr(dst1));
       } else
       if (op8 == Iop_Add8 && flag == WithFlagOverX) {
-         /* normal store */
          helper_ADCX_ADOX( False/*!isADCX*/, size, dst1, dst0, src );
+         putIRegG(size, pfx, rm, mkexpr(dst1));
       } else {
          assign( dst1, binop(mkSizedOp(ty,op8), mkexpr(dst0), mkexpr(src)) );
          if (isAddSub(op8))