]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user/s390x: Add build asserts for sigset sizes
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 28 Apr 2021 19:34:06 +0000 (12:34 -0700)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 15 May 2021 19:44:38 +0000 (21:44 +0200)
At point of usage, it's not immediately obvious that
we don't need a loop to copy these arrays.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210428193408.233706-14-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/s390x/signal.c

index 81ba59b46af516160b6e62cbd628e55c99f244f2..839a7ae4b3d6a14269b20961b6c8eedc09f32cb9 100644 (file)
@@ -141,6 +141,8 @@ void setup_frame(int sig, struct target_sigaction *ka,
         return;
     }
 
+    /* Make sure that we're initializing all of oldmask. */
+    QEMU_BUILD_BUG_ON(ARRAY_SIZE(frame->sc.oldmask) != 1);
     __put_user(set->sig[0], &frame->sc.oldmask[0]);
 
     save_sigregs(env, &frame->sregs);
@@ -266,6 +268,9 @@ long do_sigreturn(CPUS390XState *env)
         force_sig(TARGET_SIGSEGV);
         return -TARGET_QEMU_ESIGRETURN;
     }
+
+    /* Make sure that we're initializing all of target_set. */
+    QEMU_BUILD_BUG_ON(ARRAY_SIZE(target_set.sig) != 1);
     __get_user(target_set.sig[0], &frame->sc.oldmask[0]);
 
     target_to_host_sigset_internal(&set, &target_set);