summaryrefslogtreecommitdiffstats
path: root/gdb/i387-nat.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2001-12-13 17:34:52 +0000
committerKevin Buettner <kevinb@redhat.com>2001-12-13 17:34:52 +0000
commit5d003c95923bce6c630e7c37873d667d0c273d0f (patch)
treee222c9df7c6a57ffa8793b22de6f0c59200587ff /gdb/i387-nat.c
parent105ba819229cbdaf720200da3138847f57e70167 (diff)
downloadppe42-binutils-5d003c95923bce6c630e7c37873d667d0c273d0f.tar.gz
ppe42-binutils-5d003c95923bce6c630e7c37873d667d0c273d0f.zip
* i387-nat.c (i387_fill_fxsave): Change type of ``val'' from char
to short so that we don't memcpy() beyond the end of this buffer. Also, change shift value used in computing val to account for the fact that only eight bits are used.
Diffstat (limited to 'gdb/i387-nat.c')
-rw-r--r--gdb/i387-nat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/i387-nat.c b/gdb/i387-nat.c
index b15184e5d5..f792336d38 100644
--- a/gdb/i387-nat.c
+++ b/gdb/i387-nat.c
@@ -270,7 +270,7 @@ i387_fill_fxsave (char *fxsave, int regnum)
{
/* Converting back is much easier. */
- unsigned char val = 0;
+ unsigned short val = 0;
unsigned short ftag;
int fpreg;
@@ -281,7 +281,7 @@ i387_fill_fxsave (char *fxsave, int regnum)
int tag = (ftag >> (fpreg * 2)) & 3;
if (tag != 3)
- val |= (1 << (fpreg * 2));
+ val |= (1 << fpreg);
}
memcpy (FXSAVE_ADDR (fxsave, i), &val, 2);
OpenPOWER on IntegriCloud