summaryrefslogtreecommitdiffstats
path: root/src/fortranscanner.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-04-15 17:39:31 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-04-15 17:39:31 (GMT)
commit80e57e7490f899e64a1f931afb93fa900bc9e221 (patch)
tree8a75805a83462304f89afd7381603e6c9074a35c /src/fortranscanner.l
parentcd63af1e16e6194da328d95a81b546e27b873e78 (diff)
downloadDoxygen-80e57e7490f899e64a1f931afb93fa900bc9e221.zip
Doxygen-80e57e7490f899e64a1f931afb93fa900bc9e221.tar.gz
Doxygen-80e57e7490f899e64a1f931afb93fa900bc9e221.tar.bz2
Windows crash in case of incorrect end statement
Some Fortran compilers accept the END statement instead of the mandatory END TYPE. The code crashes on Windows as no correct END statement is found.
Diffstat (limited to 'src/fortranscanner.l')
-rw-r--r--src/fortranscanner.l10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 7d7437d..848b17e 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -698,6 +698,14 @@ private {
typeMode = false;
yy_pop_state();
}
+^{BS}"end"{BS}/(\n|!|;) { /* incorrect end type definition */
+ warn(yyFileName,yyLineNr, "Found 'END' instead of 'END TYPE'");
+ last_entry->parent()->endBodyLine = yyLineNr;
+ if (!endScope(current_root))
+ yyterminate();
+ typeMode = false;
+ yy_pop_state();
+ }
}
/*------- module/global/typedef variable ---------------------------------------------------*/
@@ -2819,7 +2827,7 @@ static void scanner_abort()
// dummy call to avoid compiler warning
(void)yy_top_state();
-
+
return;
//exit(-1);
}