This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR c++/36411: [4.4 regression] ICE with invalid template template parameter


On Mon, Feb 23, 2009 at 1:22 PM, Jason Merrill <jason@redhat.com> wrote:
> H.J. Lu wrote:
>>
>>       parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));
>>       +      if (parm == error_mark_node)
>> +       return 0;
>
> Please check for error_mark_node before taking the TREE_VALUE, as the loops
> lower in the function do.  Volker's patch also has the problem of taking
> TREE_VALUE of an error_mark_node, which is undefined.
>
> Jason
>
>

The current code is

 if (TREE_VEC_ELT (parm_parms, nparms - 1) != error_mark_node)
    {
      parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));

 ....

We check error_mark_node on TREE_VEC_ELT. But we missed
error_mark_node on TREE_VALUE.  Volker's patch checks it.
Did I miss something?

Thanks.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]