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@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user