The following two lines of code always convert the 64-bit pointer to a 32-bit
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 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/host_ppc_isel.c b/priv/host_ppc_isel.c
index 71c7b79..691b911 100644
--- a/priv/host_ppc_isel.c
+++ b/priv/host_ppc_isel.c
@@ -3678,7 +3678,8 @@
                                            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 @@
                                           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) ) );
          }