From 21a305d4af4491e445fa677f04e602c5d834f079 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 6 Aug 2011 17:49:21 +0000 Subject: [PATCH] Use the size of struct fpreg rather than of the pointer to it when copying the FPU state. Reviewed by: marcel Approved by: re (kib) MFC after: 1 week --- lib/libthread_db/arch/amd64/libpthread_md.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libthread_db/arch/amd64/libpthread_md.c b/lib/libthread_db/arch/amd64/libpthread_md.c index 646d36d564f..624e650cacf 100644 --- a/lib/libthread_db/arch/amd64/libpthread_md.c +++ b/lib/libthread_db/arch/amd64/libpthread_md.c @@ -92,18 +92,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) void pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { - memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(r)); + + memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(*r)); } void pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { - memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(r)); + + memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(*r)); } void pt_md_init(void) { + /* Nothing to do */ }