From: Carl Love Date: Tue, 6 Jan 2015 19:47:51 +0000 (+0000) Subject: The following two lines of code always convert the 64-bit pointer to a 32-bit X-Git-Tag: svn/VALGRIND_3_11_0^2~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37bd462daad0106144151426352cb028ac56b305;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/VEX/priv/host_ppc_isel.c b/VEX/priv/host_ppc_isel.c index 71c7b79b58..691b9111a4 100644 --- a/VEX/priv/host_ppc_isel.c +++ b/VEX/priv/host_ppc_isel.c @@ -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) ) ); }