[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [BUG] signed 16 bits word load for bigendian targets.
From: |
J. Mayer |
Subject: |
[Qemu-devel] [BUG] signed 16 bits word load for bigendian targets. |
Date: |
Sun, 22 Feb 2004 01:56:19 +0100 |
If the LSB is negative, the result is false.
Here's the patch:
Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.20
diff -u -d -w -B -b -d -p -r1.20 cpu-all.h
--- cpu-all.h 16 Feb 2004 21:57:02 -0000 1.20
+++ cpu-all.h 22 Feb 2004 00:53:28 -0000
@@ -202,7 +202,7 @@ static inline int lduw_raw(void *ptr)
static inline int ldsw_raw(void *ptr)
{
int8_t *b = (int8_t *) ptr;
- return (b[0]<<8|b[1]);
+ return (b[0]<<8 | (uint8_t)b[1]);
}
--
J. Mayer <address@hidden>
Never organized