Re: [RFA] p-typeprint.c, move pointer use to after null-check.

Joel Brobecker
2011-03-08T05:10:56Z

> If it's worth checking for null...
>
> OK?
>

> 2011-03-01 Michael Snyder <msnyder@vmware.com>
>
> * p-typeprint.c (pascal_type_print_method_args): Don't use
> pointer until after null-check.

I think I get the drift of the code, and ISTM that the check for NULL
might be misleading. I think that "physname" can never be null, by
virtue of how it's called. What I would do is just remove the check
against NULL (we can add a gdb_assert at the same time, which would
force us to declare the is_constructor/is_destructor variables without
initial value - no big deal).

Pierre?

A few remarks:

The function could (should?) be made static, unless I grep'ed wrong

> + if (is_constructor || is_destructor)
> + {
> + physname += 6;
> + }

Useless extra curly braces...

--
Joel