Mesa (master): tgsi: fix rbug compile error

Marek Olšák mareko at kemper.freedesktop.org
Sat Dec 11 12:49:34 UTC 2010


Module: Mesa
Branch: master
Commit: c398f1544ea113279e5f038f4a643005743cab62
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c398f1544ea113279e5f038f4a643005743cab62

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat Dec 11 08:38:39 2010 +0100

tgsi: fix rbug compile error

../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 <maraeo at gmail.com>

---

 src/gallium/auxiliary/tgsi/tgsi_parse.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h
index d4df585..2aafa2a 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;
 }
 




More information about the mesa-commit mailing list