[Mesa-dev] [PATCH] glsl: Fix (and validate) comment above glsl_type::name.

Ian Romanick idr at freedesktop.org
Wed Apr 10 14:33:50 PDT 2013


On 04/10/2013 01:32 PM, Kenneth Graunke wrote:
> On 04/09/2013 09:01 PM, Paul Berry wrote:
>> The comment above glsl_type::name claimed that it could sometimes be
>> NULL.  This was wrong--it is never NULL.  Many error handling paths
>> would segfault if it were.
>>
>> Fix the comment and add assertions to validate that it really is never
>> NULL.
>> ---
>>   src/glsl/glsl_types.cpp | 4 ++++
>>   src/glsl/glsl_types.h   | 3 +--
>>   2 files changed, 5 insertions(+), 2 deletions(-)
>
> I could've sworn I've actually seen it be NULL for anonymous structures.
>   What do those use?  ""?

They get a name like "#anon_struct_0001".  See the ast_struct_specifier 
constructor in glsl_parser_extras.cpp.  It may be worth mentioning this 
either in the commit message or in the code somewhere.

> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list