This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR77972 ICE on broken character continuation with -Wall etc.
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 Oct 2016 19:04:04 -0700
- Subject: [patch, fortran] PR77972 ICE on broken character continuation with -Wall etc.
- Authentication-results: sourceware.org; auth=none
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 "