[Mesa-dev] [PATCH] mesa: don't memcmp() off the end of a cache key.

Adam Jackson ajax at redhat.com
Mon Apr 1 06:12:47 PDT 2013


On Mon, 2013-04-01 at 13:04 +1300, Chris Forbes wrote:

> @@ -38,6 +38,7 @@ struct cache_item
>  {
>     GLuint hash;
>     void *key;
> +   GLuint keysize;
>     struct gl_program *program;
>     struct cache_item *next;
>  };

Since GLuint is 32 bits, this creates another hole in the struct on
LP64.  This would be better written as:

struct cache_item {
    GLuint hash;
    GLuint keysize;
    void *key;
    struct gl_program *program;
    struct cache_item *next;
};

Looks good otherwise.

- ajax




More information about the mesa-dev mailing list