]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The following two lines of code always convert the 64-bit pointer to a 32-bit
authorCarl Love <cel@us.ibm.com>
Tue, 6 Jan 2015 19:47:51 +0000 (19:47 +0000)
committerCarl Love <cel@us.ibm.com>
Tue, 6 Jan 2015 19:47:51 +0000 (19:47 +0000)
pointer.

 target = toUInt( Ptr_to_ULong(h_calc_BCDtoDPB ) );

    and

 target = toUInt( Ptr_to_ULong( h_calc_DPBtoBCD ) );

The toUInt() should only be used if we are running in 32-bit mode.  The lines
were changed to only convert the pointer to 32-bit if running in 32-bit mode.

There is no bugzilla for this issue.  It was noticed by Florian Krohm.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3060

VEX/priv/host_ppc_isel.c

index 71c7b79b58dfa40014520b81cde87b30acd1ab57..691b9111a46602288b4bda2d80a11f3619e1b3b5 100644 (file)
@@ -3678,7 +3678,8 @@ static void iselInt64Expr_wrk ( HReg* rHi, HReg* rLo,
                                            mk_RetLoc_simple(RLPri_2Int) ) );
          } else {
              ULong       target;
-             target = toUInt( Ptr_to_ULong(h_calc_BCDtoDPB ) );
+             target = mode64 ? Ptr_to_ULong(h_calc_BCDtoDPB) :
+                 toUInt( Ptr_to_ULong(h_calc_BCDtoDPB ) );
              addInstr( env, PPCInstr_Call( cc, (Addr64)target,
                                            argiregs,
                                            mk_RetLoc_simple(RLPri_2Int) ) );
@@ -3725,7 +3726,8 @@ static void iselInt64Expr_wrk ( HReg* rHi, HReg* rLo,
                                           mk_RetLoc_simple(RLPri_2Int) ) );
          } else {
              ULong       target;
-             target = toUInt( Ptr_to_ULong( h_calc_DPBtoBCD ) );
+             target = mode64 ? Ptr_to_ULong(h_calc_DPBtoBCD) :
+                 toUInt( Ptr_to_ULong( h_calc_DPBtoBCD ) );
              addInstr(env, PPCInstr_Call( cc, (Addr64)target, argiregs,
                                           mk_RetLoc_simple(RLPri_2Int) ) );
          }