From c398f1544ea113279e5f038f4a643005743cab62 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 11 Dec 2010 08:38:39 +0100 Subject: [PATCH] tgsi: fix rbug compile error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../mesa/src/gallium/auxiliary/tgsi/tgsi_parse.h:139: error: dereferencing pointer ‘tokens.25’ does break strict-aliasing rules Signed-off-by: Marek Olšák --- src/gallium/auxiliary/tgsi/tgsi_parse.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h index d4df5851764..2aafa2a6e83 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.h +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.h @@ -136,7 +136,8 @@ tgsi_parse_token( static INLINE unsigned tgsi_num_tokens(const struct tgsi_token *tokens) { - struct tgsi_header header = *(const struct tgsi_header *) tokens; + struct tgsi_header header; + memcpy(&header, tokens, sizeof(header)); return header.HeaderSize + header.BodySize; } -- 2.30.2