]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: fix DISP20 macro. Remove duplicate defn and avoid problems of
authorJulian Seward <jseward@acm.org>
Mon, 9 May 2011 20:35:41 +0000 (20:35 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 9 May 2011 20:35:41 +0000 (20:35 +0000)
right-shifting negative values.  Fixes #272067.
(Florian Krohm, britzel@acm.org)

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

VEX/priv/host_s390_defs.c

index e631cfd0eb6822c5e3af67eebf1249d96a4e5524..65cd05a8d909260f11eccc21705feb9e8b284d07 100644 (file)
@@ -3400,7 +3400,7 @@ s390_emit_SXBR(UChar *p, UChar r1, UChar r2)
 
 /* Split up a 20-bit displacement into its high and low piece
    suitable for passing as function arguments */
-#define DISP20(d) ((d) & 0xFFF), (((d) >> 12) & 0xFF)
+#define DISP20(d) (((UInt)d) & 0xFFF), ((((UInt)d) >> 12) & 0xFF)
 
 /*---------------------------------------------------------------*/
 /*--- Helper functions                                        ---*/
@@ -3932,10 +3932,6 @@ s390_emit_LDGRw(UChar *p, UChar r1, UChar r2)
 }
 
 
-/* Split up a 20-bit displacement into its high and low piece
-   suitable for passing as function arguments */
-#define DISP20(d) ((d) & 0xFFF), (((d) >> 12) & 0xFF)
-
 /*---------------------------------------------------------------*/
 /*--- Constructors for the various s390_insn kinds            ---*/
 /*---------------------------------------------------------------*/