public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran] Bug 71686 - ICE on broken character continuation
@ 2016-06-29  5:59 Jerry DeLisle
  0 siblings, 0 replies; only message in thread
From: Jerry DeLisle @ 2016-06-29  5:59 UTC (permalink / raw)
  To: fortran, gcc-patches

I plan to commit this patch as obvious and simple.

Regression tested on x86-64.  I will provide two test cases from the PR

Regards,

Jerry

2016-06-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/71686
	* scanner.c (gfc_next_char_literal): Only decrement nextc if it
	is not NULL.

diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 6a7a5b68..be9c5091 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1416,7 +1416,8 @@ restart:
         {
           if (in_string)
             {
-             gfc_current_locus.nextc--;
+             if (gfc_current_locus.nextc)
+               gfc_current_locus.nextc--;
               if (warn_ampersand && in_string == INSTRING_WARN)
                 gfc_warning (OPT_Wampersand,
                              "Missing %<&%> in continued character "
@@ -1427,7 +1428,10 @@ restart:
           /* Both !$omp and !$ -fopenmp continuation lines have & on the
              continuation line only optionally.  */
           else if (openmp_flag || openacc_flag || openmp_cond_flag)
-           gfc_current_locus.nextc--;
+           {
+             if (gfc_current_locus.nextc)
+                 gfc_current_locus.nextc--;
+           }
           else
             {
               c = ' ';

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-29  5:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29  5:59 [patch, fortran] Bug 71686 - ICE on broken character continuation Jerry DeLisle

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).