]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fixed sign-extension bug for branches
authorCerion Armour-Brown <cerion@valgrind.org>
Fri, 24 Jun 2005 11:25:46 +0000 (11:25 +0000)
committerCerion Armour-Brown <cerion@valgrind.org>
Fri, 24 Jun 2005 11:25:46 +0000 (11:25 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1223

VEX/priv/guest-ppc32/toIR.c

index 0397b32860385e055a4053602a32534984a86254..30827bb075ff2d07ab420547db80cc47bce05983 100644 (file)
@@ -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;