This is the mail archive of the gcc-bugs@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]

[Bug fortran/47180] [OOP] EXTENDS_TYPE_OF returns the wrong result for disassociated polymorphic pointers


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47180

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-05 18:34:10 UTC ---
REOPEN: Causes build issues (cf. comment 7).

      gfc_symbol *vtab;
      if (expr2->ts.type == BT_DERIVED)
        vtab = gfc_find_derived_vtab (expr2->ts.u.derived);
      else if (expr2->expr_type == EXPR_NULL)
        vtab = gfc_find_derived_vtab (expr1->ts.u.derived);
      gcc_assert (vtab);

Which means that "vtab" is not initialized if the "if"/"if else" branch is not
entered.

Simple solution:

-     gfc_symbol *vtab;
+     gfc_symbol *vtab = NULL;


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