On Mon, Sep 17, 2018 at 1:53 PM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
> Hi again,
>
> On 9/3/18 10:59 PM, Paolo Carlini wrote:
>>
>> in this error-recovery ICE, upon the error make_constrained_auto assigns
>> error_mark_node to PLACEHOLDER_TYPE_CONSTRAINTS (type) which then causes a
>> crash later when hash_placeholder_constraint is called on it. I think we
>> should cope with this somehow, I believe that consistency with the way we
>> use error_mark_node in this part of the front-end prevents us from avoiding
>> to assign the error_mark_node in the first place and, for the reasons
>> explained in my previous patch, we want to unconditionally call
>> make_constrained_auto. This said, catching in practice the error_mark_node
>> would normally mean renouncing to the pattern 'if (tree c = ...)' which we
>> lately appear to like a lot and seems indeed neat. Thus I'm wondering if we
>> want instead to add a macro like ERROR_AS_NULL, which of course would be
>> also useful in many other places - essentially in all the circumstances
>> where we want to check for a kosher node, thus neither null nor
>> error_mark_node. What do you think? What about the name, in case? Tested
>> x86_64-linux.
>
>
> Today I reviewed again this issue, for which I sent a tentative patch a
> couple of weeks ago. All in all, I still believe that is the right place to
> catch the error_mark_node and avoid ICE-ing later, the quick rationale being
> that PLACEHOLDER_TYPE_CONSTRAINTS can be error_mark_node for other reasons
> too. As regards the ERROR_AS_NULL idea, I'm still not sure, on one hand it
> would allow for more compact and neat code in some cases, on the other hand
> could be seen as some sort of obfuscation - well, some people out there
> consider an obfuscation the very 'if (c =...)' pattern ;) Anyway, I'm
> attaching the normal versions of the fix, which, per a recent message from
> Jason, probably is almost obvious...

Hmm, I do kind of like the ERROR_AS_NULL idea.  I might call it
NON_ERROR, though.  OK with that change.

Jason

Reply via email to