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, fortran] PR43945 - [OOP] Derived type with GENERIC: resolved to the wrong specific TBP


Tobias Burnus wrote:
> It is interesting if one follows "class_ref" in
> resolve_typebound_subroutine. Before
>   resolve_typebound_call (code, &name);
> it is still "type = REF_COMPONENT" but afterwards it is type = 2893287512.
>   

Which makes sense:

resolve_typebound_subroutine (gfc_code *code)
{
  declared = get_declared_from_expr (&class_ref, &new_ref, code->expr1);
  resolve_typebound_call (code, &name);
  if (class_ref)

and

resolve_typebound_call (gfc_code* c, const char **name)
{
  gfc_free_expr (c->expr1);

Thus, it is not surprising that it won't work if one frees c->expr1 -
and then uses c->expr1->ref == class_ref later.

Tobias


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