]> git.ipfire.org Git - thirdparty/valgrind.git/commit
VEX, ppc fix use of modified value in the Iop_32HLto64 implementation
authorCarl Love <cel@us.ibm.com>
Tue, 20 Nov 2012 17:32:48 +0000 (17:32 +0000)
committerCarl Love <cel@us.ibm.com>
Tue, 20 Nov 2012 17:32:48 +0000 (17:32 +0000)
commit5f62a49abf3a7eeb2f925a7252f3a3bc78493a5c
tree55fcaf148f52ff00c394103b576354f6334d224f
parentd3d96f5530f3598ea777bf993ef0efd65bc6b64a
VEX, ppc fix use of modified value in the Iop_32HLto64 implementation

The issue with the Iop_32HLto64, as explained by Julian:
One of the "rules of the game" of instruction selection is that the register
returned by any of the isel* functions may not be modified -- if it needs to
be modified, first copy the value off to a different register. The rule exists
because, in this case, e->Iex.Binop.arg2 might be an IRExpr_RdTmp, in which
case iselWordExpr_R simply returns the register which holds the value of the
relevant IR temporary. And so if r_Lo is modified then any subsequent uses of
that IR temporary will get the wrong value. In this case, r_Lo is
modified without first copying it.

This patch fixes the issue by assigning the result of the AND operation to
a temporary and then using the temporary result in the OR operation thus
avoiding using a modified value.

This patch is for bugzilla 309922.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2563
VEX/priv/host_ppc_isel.c