This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47180] [OOP] EXTENDS_TYPE_OF returns the wrong result for disassociated polymorphic pointers
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 5 Jan 2011 18:34:20 +0000
- Subject: [Bug fortran/47180] [OOP] EXTENDS_TYPE_OF returns the wrong result for disassociated polymorphic pointers
- Auto-submitted: auto-generated
- References: <bug-47180-4@http.gcc.gnu.org/bugzilla/>
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;