This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[patch, fortran] PR77972 ICE on broken character continuation with -Wall etc.


This patch is straight forward. We were sending bogus locus info to the diagnostics machinery and catch an assert in error,c.

The patch avoids doing this.

Regression tested on x86-64-linux.

OK for trunk?

Regards,

Jerry

2016-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* scanner.c (gfc_next_char_literal): If nextc is null do not
	decrement the pointer and call the diagnostics.

diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index be9c5091..5e355359 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1414,10 +1414,9 @@ restart:

       if (c != '&')
        {
-         if (in_string)
+         if (in_string && gfc_current_locus.nextc)
            {
-             if (gfc_current_locus.nextc)
-               gfc_current_locus.nextc--;
+             gfc_current_locus.nextc--;
              if (warn_ampersand && in_string == INSTRING_WARN)
                gfc_warning (OPT_Wampersand,
                             "Missing %<&%> in continued character "


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