public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66052] Segmentation fault for misplaced protected statement
       [not found] <bug-66052-4@http.gcc.gnu.org/bugzilla/>
@ 2015-05-07 14:58 ` kargl at gcc dot gnu.org
  2015-05-18 22:53 ` kargl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-07 14:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66052

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-07
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
Confirmed.

This patch

Index: decl.c
===================================================================
--- decl.c      (revision 222869)
+++ decl.c      (working copy)
@@ -6968,7 +6968,8 @@ gfc_match_protected (void)
   gfc_symbol *sym;
   match m;

-  if (gfc_current_ns->proc_name->attr.flavor != FL_MODULE)
+  if (gfc_current_ns->proc_name &&
+      gfc_current_ns->proc_name->attr.flavor != FL_MODULE)
     {
        gfc_error ("PROTECTED at %C only allowed in specification "
                  "part of a module");

gives

% gfc6 -c po.f90
po.f90:3:13:

   protected x
             1
Error: Unexpected attribute declaration statement in CONTAINS section at (1)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/66052] Segmentation fault for misplaced protected statement
       [not found] <bug-66052-4@http.gcc.gnu.org/bugzilla/>
  2015-05-07 14:58 ` [Bug fortran/66052] Segmentation fault for misplaced protected statement kargl at gcc dot gnu.org
@ 2015-05-18 22:53 ` kargl at gcc dot gnu.org
  2015-05-19 18:11 ` kargl at gcc dot gnu.org
  2015-05-19 18:15 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-18 22:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66052

--- Comment #2 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon May 18 22:52:52 2015
New Revision: 223324

URL: https://gcc.gnu.org/viewcvs?rev=223324&root=gcc&view=rev
Log:
2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66052
        * decl.c(gfc_match_protected): Prevent dereference of NULL pointer. 

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66052
        * gfortran.dg/protected_9.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/protected_9.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/66052] Segmentation fault for misplaced protected statement
       [not found] <bug-66052-4@http.gcc.gnu.org/bugzilla/>
  2015-05-07 14:58 ` [Bug fortran/66052] Segmentation fault for misplaced protected statement kargl at gcc dot gnu.org
  2015-05-18 22:53 ` kargl at gcc dot gnu.org
@ 2015-05-19 18:11 ` kargl at gcc dot gnu.org
  2015-05-19 18:15 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 18:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66052

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Tue May 19 18:10:44 2015
New Revision: 223408

URL: https://gcc.gnu.org/viewcvs?rev=223408&root=gcc&view=rev
Log:
2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66052
        * decl.c(gfc_match_protected): Prevent dereference of NULL pointer. 

2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66052
        * gfortran.dg/protected_9.f90: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/protected_9.f90
Modified:
    branches/gcc-5-branch/gcc/fortran/ChangeLog
    branches/gcc-5-branch/gcc/fortran/decl.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/66052] Segmentation fault for misplaced protected statement
       [not found] <bug-66052-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-05-19 18:11 ` kargl at gcc dot gnu.org
@ 2015-05-19 18:15 ` kargl at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 18:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66052

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.2

--- Comment #4 from kargl at gcc dot gnu.org ---
Fixed on trunk and 5-branch.  Thanks for the bug report.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-19 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-66052-4@http.gcc.gnu.org/bugzilla/>
2015-05-07 14:58 ` [Bug fortran/66052] Segmentation fault for misplaced protected statement kargl at gcc dot gnu.org
2015-05-18 22:53 ` kargl at gcc dot gnu.org
2015-05-19 18:11 ` kargl at gcc dot gnu.org
2015-05-19 18:15 ` kargl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).