summary refs log tree commit diff stats
path: root/linux-user/signal.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-07-30 15:29:11 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-08-09 18:34:57 +0000
commit8954bae3ce1ae5b64218b8731da9a8d7f46db9a7 (patch)
tree22b3e4adbb5bf66b7b7999ac3b02cb943a9f1312 /linux-user/signal.c
parentacfbe712df86e20634b7860be91e16ae9aa39cd0 (diff)
downloadfocaccia-qemu-8954bae3ce1ae5b64218b8731da9a8d7f46db9a7.tar.gz
focaccia-qemu-8954bae3ce1ae5b64218b8731da9a8d7f46db9a7.zip
sparc: fix expression with uninitialized initial value
err was uninitialized, it's not OK to use |=. Spotted by Clang
compiler.

Fix by implementing the earlier statement which initializes the variable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r--linux-user/signal.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 9be5ac0788..78691473fa 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -1844,7 +1844,7 @@ typedef struct {
 } __siginfo_t;
 
 typedef struct {
-        unsigned   long si_float_regs [32];
+        abi_ulong       si_float_regs[32];
         unsigned   long si_fsr;
         unsigned   long si_fpqdepth;
         struct {
@@ -2056,11 +2056,9 @@ restore_fpu_state(CPUSPARCState *env, qemu_siginfo_fpu_t *fpu)
                 return -EFAULT;
 #endif
 
-#if 0
         /* XXX: incorrect */
-        err = __copy_from_user(&env->fpr[0], &fpu->si_float_regs[0],
-	                             (sizeof(unsigned long) * 32));
-#endif
+        err = copy_from_user(&env->fpr[0], fpu->si_float_regs[0],
+                             (sizeof(abi_ulong) * 32));
         err |= __get_user(env->fsr, &fpu->si_fsr);
 #if 0
         err |= __get_user(current->thread.fpqdepth, &fpu->si_fpqdepth);