Re: [PATCH] Fix mi "-var-create" regression

Luis Machado
2012-10-11T22:10:50Z

On 10/11/2012 06:53 PM, Sergio Durigan Junior wrote:
> On Wednesday, October 10 2012, Luis Gustavo wrote:
>
>> Hi,
>
> Hey Luis :-)

Hey!

> 1) I believe you could remove some of the parentheses in the `if'
> above. Something like:
>
> if ((TYPE_CODE (result) == TYPE_CODE_PTR
> || TYPE_CODE (result) == TYPE_CODE_REF)
> && TYPE_TARGET_TYPE (result) != NULL
> && TYPE_CODE (TYPE_TARGET_TYPE (result)) != TYPE_CODE_VOID)
>
> would have the same effect, right?

Ah, of course. Thanks for noticing that.

>
> 2) Would it be possible to provide a testcase for this issue? Not sure
> if it's really needed, but I guess it won't hurt :-). Of course, if
> some maintainer thinks it's useless, then please disconsider the idea
> right away.

I thought about this for a while, and the best testing mechanism seems
to be just turning the "print object" option on by default and running
the entire testsuite, otherwise this test will be very specific to the
-var-create mechanism.

value_actual_type is called from 3 different places IIRC.

If we're thinking about a regression coverage test, then i agree that a
test is appropriate in this case, so we can be sure it will never happen
again.

Luis