[Mesa-dev] [PATCH] glsl: Fix (and validate) comment above glsl_type::name.
Paul Berry
stereotype441 at gmail.com
Thu Apr 11 09:24:03 PDT 2013
On 10 April 2013 14:33, Ian Romanick <idr at freedesktop.org> wrote:
> 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.
>
I'll mention it in the commit message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130411/7d5f7ba8/attachment-0001.html>
More information about the mesa-dev
mailing list