gallium/util: fix crash with daz detection on x86
authorRoland Scheidegger <sroland@vmware.com>
Wed, 31 Dec 2014 16:39:57 +0000 (17:39 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Mon, 5 Jan 2015 16:58:38 +0000 (17:58 +0100)
The code used PIPE_ALIGN_VAR for the variable used by fxsave, however this
does not work if the stack isn't aligned. Hence use PIPE_ALIGN_STACK function
decoration to fix the segfault which can happen if stack alignment is only
4 bytes.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87658.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/util/u_cpu_detect.c

index 5d9db59d16b76bb1fd330b85742eb06d2574cfeb..28197f4a9d8354cd834c9314fff7a10ece2f026e 100644 (file)
@@ -272,7 +272,7 @@ static INLINE uint64_t xgetbv(void)
 
 
 #if defined(PIPE_ARCH_X86)
-static INLINE boolean sse2_has_daz(void)
+PIPE_ALIGN_STACK static INLINE boolean sse2_has_daz(void)
 {
    struct {
       uint32_t pad1[7];