From: Cerion Armour-Brown Date: Fri, 24 Jun 2005 11:25:46 +0000 (+0000) Subject: fixed sign-extension bug for branches X-Git-Tag: svn/VALGRIND_3_0_1^2~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0f6c26baf3a0e981b2c084f85ff09750f4e33e5;p=thirdparty%2Fvalgrind.git fixed sign-extension bug for branches git-svn-id: svn://svn.valgrind.org/vex/trunk@1223 --- diff --git a/VEX/priv/guest-ppc32/toIR.c b/VEX/priv/guest-ppc32/toIR.c index 0397b32860..30827bb075 100644 --- a/VEX/priv/guest-ppc32/toIR.c +++ b/VEX/priv/guest-ppc32/toIR.c @@ -477,9 +477,9 @@ static UInt extend_s_16to32 ( UInt x ) return (UInt)((((Int)x) << 16) >> 16); } -static UInt extend_s_24to32 ( UInt x ) +static UInt extend_s_26to32 ( UInt x ) { - return (UInt)((((Int)x) << 8) >> 8); + return (UInt)((((Int)x) << 6) >> 6); } /* Do a big-endian load of a 32-bit word, regardless of the endianness @@ -2441,7 +2441,7 @@ static Bool dis_branch ( UInt theInstr, DisResult *whatNext ) UChar flag_LK = toUChar((theInstr >> 0) & 1); /* theInstr[0] */ Int exts_BD = (Int)extend_s_16to32(BD << 2); - Int exts_LI = (Int)extend_s_24to32(LI_24 << 2); + Int exts_LI = (Int)extend_s_26to32(LI_24 << 2); Addr32 nia = 0;