]> git.proxmox.com Git - qemu.git/commitdiff
sparc: fix expression with uninitialized initial value
authorBlue Swirl <blauwirbel@gmail.com>
Mon, 30 Jul 2012 15:29:11 +0000 (15:29 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 9 Aug 2012 18:34:57 +0000 (18:34 +0000)
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>
linux-user/signal.c

index 9be5ac07889930b17d4414c7a6ba1ae65354d0a2..78691473fa9101788e208c3c339c8c0a59418624 100644 (file)
@@ -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);